<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<groupId>ch.bind</groupId>
	<artifactId>philib</artifactId>
	<version>0.14.0</version>
	<packaging>jar</packaging>

	<name>philib</name>
	<description>philib is a small java library containing utility classes</description>
	<url>https://github.com/phicode/philib</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
		<maven.compiler.optimize>true</maven.compiler.optimize>
		<maven.compiler.showWarnings>true</maven.compiler.showWarnings>
		<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>
		<maven.compiler.compilerArgument>-Xlint:unchecked</maven.compiler.compilerArgument>

		<!-- the following two properties are adjusted if the profile 'bench' is 
			activated -->
		<runBenchmarks>false</runBenchmarks>
		<testMaxMemory>256</testMaxMemory>
	</properties>

	<licenses>
		<license>
			<name>MIT License</name>
			<url>http://www.opensource.org/licenses/mit-license.php</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<scm>
		<!-- read only connection -->
		<connection>scm:git:https://github.com/phicode/philib</connection>
		<!-- read/write connection -->
		<developerConnection>scm:git:https://bind.ch/git/phil/philib</developerConnection>
		<!-- browsable url -->
		<url>https://github.com/phicode/philib</url>
		<tag>HEAD</tag>
	</scm>

	<developers>
		<developer>
			<name>Philipp Meinen</name>
			<email>philipp@bind.ch</email>
			<url>https://bind.ch/philib/</url>
			<timezone>1</timezone>
		</developer>
	</developers>

	<ciManagement>
		<system>jenkins</system>
		<url>https://bind.ch/jenkins/job/philib/</url>
	</ciManagement>

	<dependencies>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>1.7.32</version>
		</dependency>

		<!-- SCOPE TEST -->
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>1.2.11</version>
			<scope>test</scope>
		</dependency>

		<!-- unit testing -->
		<dependency>
			<groupId>org.testng</groupId>
			<artifactId>testng</artifactId>
			<version>7.6.0</version>
			<scope>test</scope>

			<exclusions>
				<exclusion>
					<artifactId>junit</artifactId>
					<groupId>junit</groupId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<version>4.6.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>3.0.0-M6</version>
				<configuration>
					<!-- During release:perform, enable the "release" profile -->
					<releaseProfiles>release</releaseProfiles>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.10.1</version>
				<!--				<configuration>-->
				<!--					<compilerId>javac-with-errorprone</compilerId>-->
				<!--					<forceJavacCompilerUse>true</forceJavacCompilerUse>-->
				<!--				</configuration>-->
				<!--				<dependencies>-->
				<!--					<dependency>-->
				<!--						<groupId>org.codehaus.plexus</groupId>-->
				<!--						<artifactId>plexus-compiler-javac-errorprone</artifactId>-->
				<!--						<version>2.8.8</version>-->
				<!--					</dependency>-->
				<!--					&lt;!&ndash; override plexus-compiler-javac-errorprone's dependency on-->
				<!--					Error Prone with the latest version &ndash;&gt;-->
				<!--					<dependency>-->
				<!--						<groupId>com.google.errorprone</groupId>-->
				<!--						<artifactId>error_prone_core</artifactId>-->
				<!--						<version>2.8.1</version>-->
				<!--					</dependency>-->
				<!--				</dependencies>-->
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.2.0</version>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0-M7</version>
				<configuration>
					<enableAssertions>true</enableAssertions>
					<argLine>-Xmx${testMaxMemory}M -DrunBenchmarks=${runBenchmarks}</argLine>
					<suiteXmlFiles>
						<suiteXmlFile>${basedir}/src/test/resources/testng.xml</suiteXmlFile>
					</suiteXmlFiles>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.2.2</version>
				<configuration>
					<archive>
						<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
					</archive>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>5.1.6</version>
				<extensions>true</extensions>
				<executions>
					<execution>
						<id>bundle-manifest</id>
						<phase>process-classes</phase>
						<goals>
							<goal>manifest</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<instructions>
						<Export-Package>ch.bind.philib.*</Export-Package>
					</instructions>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>3.0.0</version>
				<executions>
					<execution>
						<id>enforce-maven</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireMavenVersion>
									<version>3.5</version>
								</requireMavenVersion>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>


			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>findbugs-maven-plugin</artifactId>
				<version>3.0.5</version>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<version>3.2.0</version>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>3.0.0-M2</version>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-install-plugin</artifactId>
				<version>3.0.0-M1</version>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
				<version>4.0.0-M1</version>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>cobertura-maven-plugin</artifactId>
				<version>2.7</version>
			</plugin>

			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<version>1.6.13</version>
				<extensions>true</extensions>
				<configuration>
					<serverId>ossrh</serverId>
					<!-- for newer projects: https://s01.oss.sonatype.org/ -->
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					<!--					<autoReleaseAfterClose>true</autoReleaseAfterClose>-->
					<autoReleaseAfterClose>false</autoReleaseAfterClose>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<!-- for newer projects: https://s01.oss.sonatype.org/content/repositories/snapshots -->
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>

	<profiles>
		<!-- override some properties when the bench profile is manually activated. 
			This property is accessed by the 'TestUtil' -->
		<profile>
			<id>bench</id>
			<properties>
				<runBenchmarks>true</runBenchmarks>
				<testMaxMemory>512</testMaxMemory>
			</properties>
		</profile>

		<!-- only sign artifacts when building a release -->
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.0.1</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.2.1</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>3.4.0</version>
						<configuration>
							<additionalOptions>
								<option>--add-modules</option>
								<option>org.slf4j</option>
							</additionalOptions>
						</configuration>
						<executions>
							<execution>
								<id>aggregate</id>
								<goals>
									<goal>aggregate</goal>
								</goals>
								<phase>site</phase>
							</execution>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
