<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.10.0</version>
	<name>Ares</name>
	<description>The Artemis Java Test Sandbox. A JUnit 5 Extension for secure Artemis Java Testing.</description>
	<url>https://github.com/ls1intum/Ares</url>
	<inceptionYear>2019</inceptionYear>
	<licenses>
		<license>
			<name>MIT</name>
			<url>https://opensource.org/licenses/MIT</url>
			<comments>See https://github.com/ls1intum/Ares/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/Ares</url>
		<connection>scm:git:https://github.com/ls1intum/Ares.git</connection>
		<developerConnection>scm:git:https://github.com/ls1intum/Ares.git</developerConnection>
	</scm>

	<properties>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
		<junit-jupiter-version>5.8.2</junit-jupiter-version>
		<junit-platform-version>1.8.2</junit-platform-version>
		<jqwik-version>1.6.5</jqwik-version>
		<spotless.version>2.22.5</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.11</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.22.0</version>
		</dependency>
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20220320</version>
		</dependency>
		<dependency>
			<groupId>info.debatty</groupId>
			<artifactId>java-string-similarity</artifactId>
			<version>2.0.0</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.10.1</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.2.2</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.4.0</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<tags>
						<tag>
							<name>apiNote</name>
							<placement>a</placement>
							<head>API Note:</head>
						</tag>
						<tag>
							<name>implSpec</name>
							<placement>a</placement>
							<head>Implementation Requirements:</head>
						</tag>
						<tag>
							<name>implNote</name>
							<placement>a</placement>
							<head>Implementation Note:</head>
						</tag>
						<tag>
							<name>param</name>
						</tag>
						<tag>
							<name>return</name>
						</tag>
						<tag>
							<name>throws</name>
						</tag>
						<tag>
							<name>since</name>
						</tag>
						<tag>
							<name>version</name>
						</tag>
						<tag>
							<name>serialData</name>
						</tag>
						<tag>
							<name>see</name>
						</tag>
					</tags>
				</configuration>
			</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-M6</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-M2</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>3.0.0</version>
				<executions>
					<execution>
						<id>enforce-versions</id>
						<phase>validate</phase>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireMavenVersion>
									<version>[3.6,)</version>
								</requireMavenVersion>
								<requireJavaVersion>
									<version>[11,)</version>
								</requireJavaVersion>
							</rules>
						</configuration>
					</execution>
					<execution>
						<id>enforce-no-student-code-in-trusted-packages</id>
						<phase>process-test-classes</phase>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireFilesDontExist>
									<files>
										<file>${project.build.outputDirectory}/ch/qos/logback/</file>
										<file>${project.build.outputDirectory}/com/intellij/</file>
										<file>${project.build.outputDirectory}/com/sun/</file>
										<!-- We cannot fulfill this one because we are building those classes here
										<file>${project.build.outputDirectory}/de/tum/in/test/api/</file> -->
										<file>${project.build.outputDirectory}/java/</file>
										<file>${project.build.outputDirectory}/javax/</file>
										<file>${project.build.outputDirectory}/jdk/</file>
										<file>${project.build.outputDirectory}/net/jqwik/</file>
										<file>${project.build.outputDirectory}/org/apache/</file>
										<file>${project.build.outputDirectory}/org/assertj/</file>
										<file>${project.build.outputDirectory}/org/eclipse/</file>
										<file>${project.build.outputDirectory}/org/jacoco/</file>
										<file>${project.build.outputDirectory}/org/json/</file>
										<file>${project.build.outputDirectory}/org/junit/</file>
										<file>${project.build.outputDirectory}/org/opentest4j/</file>
										<file>${project.build.outputDirectory}/sun/</file>
										<!-- Required for de.tum.in.test.api.security.ArtemisSecurityConfigurationTest -->
										<!-- <file>${project.build.outputDirectory}/abc/def/</file> -->
										<file>${project.build.outputDirectory}/org/gradle/</file>
										<file>${project.build.outputDirectory}/worker/org/gradle/</file>
									</files>
								</requireFilesDontExist>
							</rules>
						</configuration>
					</execution>
				</executions>
			</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.8</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 LS1TUM Apache Maven Packages</name>
					<url>https://maven.pkg.github.com/ls1intum/Ares</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>
		<!-- Profile for fast builds and tests (~ 16 s) -->
		<profile>
			<id>fast</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<version>3.0.0-M6</version>
						<configuration>
							<forkCount>4</forkCount>
							<reuseForks>true</reuseForks>
							<properties>
								<!-- There seem to be race conditions with forks and jqwik -->
								<configurationParameters>jqwik.database=</configurationParameters>
							</properties>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</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>3.0.1</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.13</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
