<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>de.tum.in.ase</groupId>
	<artifactId>artemis-java-test-sandbox</artifactId>
	<version>1.3.4</version>
	<name>Artemis Java Test Sandbox</name>
	<description>JUnit 5 Extension API for secure Artemis Java Testing</description>
	<url>https://github.com/ls1intum/artemis-java-test-sandbox</url>
	<inceptionYear>2019</inceptionYear>
	<licenses>
		<license>
			<name>MIT</name>
			<url>https://opensource.org/licenses/MIT</url>
			<comments>See https://github.com/ls1intum/artemis-java-test-sandbox/blob/master/LICENSE</comments>
		</license>
	</licenses>
	<developers>
		<developer>
			<name>Christian Femers</name>
			<email>christian.femers@tum.de</email>
			<organization>Technical University of Munich</organization>
			<organizationUrl>https://www.tum.de</organizationUrl>
		</developer>
	</developers>

	<scm>
		<url>https://github.com/ls1intum/artemis-java-test-sandbox</url>
		<connection>scm:git:https://github.com/ls1intum/artemis-java-test-sandbox.git</connection>
		<developerConnection>scm:git:https://github.com/ls1intum/artemis-java-test-sandbox.git</developerConnection>
	</scm>

	<properties>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
		<junit-jupiter-version>5.7.0</junit-jupiter-version>
		<junit-platform-version>1.7.0</junit-platform-version>
		<jqwik-version>1.3.4</jqwik-version>
		<spotless.version>2.6.0</spotless.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<!-- if JaCoCo is not executed -->
		<argLine></argLine>
		<!-- full certificate fingerprint: B58E410970742EF7AD0FDD48D1A045E1DD48B876 -->
		<gpg.key.id>D1A045E1DD48B876</gpg.key.id>
	</properties>

	<dependencies>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>1.2.3</version>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<version>${junit-jupiter-version}</version>
		</dependency>
		<dependency>
			<groupId>org.junit.platform</groupId>
			<artifactId>junit-platform-launcher</artifactId>
			<version>${junit-platform-version}</version>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<version>${junit-jupiter-version}</version>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-params</artifactId>
			<version>${junit-jupiter-version}</version>
		</dependency>
		<dependency>
			<groupId>org.junit.vintage</groupId>
			<artifactId>junit-vintage-engine</artifactId>
			<version>${junit-jupiter-version}</version>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest</artifactId>
			<version>2.2</version>
		</dependency>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<version>3.18.1</version>
		</dependency>
		<!-- For testing we use a test framework testing framework -->
		<dependency>
			<groupId>org.junit.platform</groupId>
			<artifactId>junit-platform-testkit</artifactId>
			<scope>test</scope>
			<version>${junit-platform-version}</version>
		</dependency>
		<!-- For testing the property based testing framework jqwik is supported -->
		<!-- (but it is not a required dependency) -->
		<dependency>
			<groupId>net.jqwik</groupId>
			<artifactId>jqwik</artifactId>
			<version>${jqwik-version}</version>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.2.0</version>
				<configuration>
					<archive>
						<manifestEntries>
							<Sealed>true</Sealed>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.2.1</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0-M5</version>
				<configuration>
					<argLine>@{argLine} -Dfile.encoding=UTF-8</argLine>
					<runOrder>alphabetical</runOrder>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>3.0.0-M1</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>3.0.0-M3</version>
				<executions>
					<execution>
						<id>enforce-versions</id>
						<phase>validate</phase>
						<goals>
							<goal>enforce</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<rules>
						<requireMavenVersion>
							<version>[3.6,)</version>
						</requireMavenVersion>
						<requireJavaVersion>
							<version>[11,)</version>
						</requireJavaVersion>
					</rules>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.diffplug.spotless</groupId>
				<artifactId>spotless-maven-plugin</artifactId>
				<version>${spotless.version}</version>
				<configuration>
					<encoding>UTF-8</encoding>
					<formats>
						<format>
							<includes>
								<inculde>*.xml</inculde>
								<include>*.java</include>
								<include>.gitignore</include>
							</includes>
							<trimTrailingWhitespace />
							<endWithNewline />
							<indent>
								<tabs>true</tabs>
								<spacesPerTab>4</spacesPerTab>
							</indent>
						</format>
					</formats>
					<java>
						<removeUnusedImports />
						<importOrder>
							<file>${basedir}/.settings/eclipse-rules.importorder</file>
						</importOrder>
						<eclipse>
							<version>4.17.0</version>
							<file>${basedir}/.settings/eclipse-formatter-rules.xml</file>
						</eclipse>
					</java>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<!-- For code coverage using JaCoCo -->
		<profile>
			<id>coverage</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>0.8.6</version>
						<executions>
							<execution>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
							</execution>
							<execution>
								<id>report</id>
								<phase>test</phase>
								<goals>
									<goal>report</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<!-- This is only for GitHub -->
		<profile>
			<id>github</id>
			<distributionManagement>
				<repository>
					<id>github</id>
					<name>GitHub MaisiKoleni Apache Maven Packages</name>
					<url>https://maven.pkg.github.com/ls1intum/artemis-java-test-sandbox</url>
				</repository>
				<!-- GitHub cannot handle snapshots correctly now, so we do nothing -->
				<snapshotRepository>
					<id>internal</id>
					<url>file://${project.build.directory}/mvn-repo</url>
				</snapshotRepository>
			</distributionManagement>
		</profile>
		<!-- This is only for GitLab as a deploy workaround -->
		<profile>
			<id>gitlab</id>
			<distributionManagement>
				<repository>
					<id>internal</id>
					<url>file://${project.build.directory}/mvn-repo</url>
				</repository>
			</distributionManagement>
		</profile>
		<!-- Profile for manually deploying to Maven Central -->
		<profile>
			<id>ossrh</id>
			<distributionManagement>
				<snapshotRepository>
					<id>ossrh</id>
					<url>https://oss.sonatype.org/content/repositories/snapshots</url>
				</snapshotRepository>
			</distributionManagement>
			<build>
				<plugins>
					<!-- Only sign the plugin if it's built manually for OSSRH -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.6</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<keyname>${gpg.key.id}</keyname>
									<passphraseServerId>${gpg.key.id}</passphraseServerId>
									<!-- This is to prevent Maven GPG not passing the passphrase correctly -->
									<!-- requires GPG version 2.1 or greater -->
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.8</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
