<?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>
    <packaging>pom</packaging>
    <groupId>org.soot-oss</groupId>
    <artifactId>sootup</artifactId>
    <version>1.3.0</version>
    <name>SootUp</name>
    <description>A new version of Soot with a completely overhauled architecture</description>
    <url>https://soot-oss.github.io/SootUp</url>
    <organization>
        <name>Soot OSS</name>
        <url>https://soot-oss.org/</url>
    </organization>
    <licenses>
        <license>
            <name>GNU LESSER GENERAL PUBLIC LICENSE 2.1</name>
            <url>https://www.gnu.org/licenses/lgpl-2.1.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Kadiray Karakaya</name>
            <email>kadiray.karakaya@uni-paderborn.de</email>
            <organization>Paderborn University</organization>
            <organizationUrl>https://www.hni.uni-paderborn.de/sse/</organizationUrl>
        </developer>
        <developer>
            <name>Jonas Klauke</name>
            <email>jonas.klauke@uni-paderborn.de</email>
            <organization>Paderborn University</organization>
            <organizationUrl>https://www.hni.uni-paderborn.de/sse/</organizationUrl>
        </developer>
        <developer>
            <name>Stefan Schott</name>
            <email>stefan.schott@uni-paderborn.de</email>
            <organization>Paderborn University</organization>
            <organizationUrl>https://www.hni.uni-paderborn.de/sse/</organizationUrl>
        </developer>
        <developer>
            <name>Markus Schmidt</name>
            <email>smarkus@mail.uni-paderborn.de</email>
            <organization>Paderborn University</organization>
            <organizationUrl>https://www.hni.uni-paderborn.de/sse/</organizationUrl>
        </developer>
        <developer>
            <name>Eric Bodden</name>
            <email>eric.bodden@uni-paderborn.de</email>
            <organization>Paderborn University</organization>
            <organizationUrl>https://www.hni.uni-paderborn.de/sse/</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git@github.com:soot-oss/SootUp.git</connection>
        <developerConnection>scm:git:git@github.com:soot-oss/SootUp.git</developerConnection>
        <url>https://github.com/soot-oss/SootUp</url>
    </scm>
    <modules>
        <module>sootup.core</module>
        <module>sootup.jimple.parser</module>
        <module>sootup.java.core</module>
        <module>sootup.java.bytecode</module>
        <module>sootup.java.sourcecode</module>
        <module>sootup.tests</module>
        <module>sootup.callgraph</module>
        <module>sootup.qilin</module>
        <module>sootup.analysis</module>
        <module>sootup.examples</module>
        <module>sootup.report</module>
    </modules>

    <!-- Shared Configuration -->
    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.version>3.8.0</maven.compiler.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
        <jacoco-maven-plugin.version>0.8.4</jacoco-maven-plugin.version>
        <slf4j.version>2.0.5</slf4j.version>
        <slf4j-simple.version>2.0.5</slf4j-simple.version>
        <guava.version>32.0.1-jre</guava.version>
        <apache-commons.version>3.12.0</apache-commons.version>
        <apache-commons-io.version>2.11.0</apache-commons-io.version>
        <junit.version>5.10.2</junit.version>
        <powermock-module-junit4.version>1.7.3</powermock-module-junit4.version>
        <powermock-api-mockito.version>1.7.3</powermock-api-mockito.version>
        <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
        <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
	<maven-release-plugin.version>3.0.1</maven-release-plugin.version>
        <licence-check.failOnMissingHeader>true</licence-check.failOnMissingHeader>
        <reactorRootsTarget>${basedir}/target</reactorRootsTarget>
    </properties>

    <profiles>
        <profile>
            <id>Java8</id>
            <properties>
                <testcase.groups>Java8</testcase.groups>
                <testCoverageType>jdk8</testCoverageType>
            </properties>
            <!-- Activates if jdk is <1.9 which means it has a rt.jar -->
            <activation>
                <jdk>(, 1.9)</jdk>
            </activation>
        </profile>
        <profile>
            <id>Java9</id>
            <properties>
                <testcase.groups>Java9</testcase.groups>
                <testCoverageType>jdk9</testCoverageType>
            </properties>
            <!-- Activates if jdk is >=1.9 which means it has a jrt Provider -->
            <activation>
                <jdk>[1.9, )</jdk>
            </activation>
        </profile>
        <profile>
            <id>IntegrationTest</id>
            <properties>
                <testcase.groups>Java8</testcase.groups>
                <testCoverageType>integrationtest</testCoverageType>
            </properties>
        </profile>
        <profile>
            <id>skipTestProfile</id>
            <activation>
                <property>
                    <name>skipTests</name>
                    <value>!false</value>
                </property>
            </activation>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- This is required to make sure the plugin does not stop asking for -->
                                    <!-- user input on the passphrase -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</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>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
		    <plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-release-plugin</artifactId>
			<version>${maven-release-plugin.version}</version>
			<configuration>
				<tagNameFormat>@{project.version}</tagNameFormat>
			</configuration>
		    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>com.coveo</groupId>
                <artifactId>fmt-maven-plugin</artifactId>
                <version>2.8</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- just define the Java version to be used for compiling and plugins -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArgs>
                        <!-- Prevents recompilation due to missing package-info.class, see MCOMPILER-205 -->
                        <arg>-Xpkginfo:always</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
                <executions>
                    <!--Prepares the property pointing to the JaCoCo runtime agent which
                        is passed as VM argument when Maven the Surefire plugin is executed. -->
                    <execution>
                        <id>pre-unit-test</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the path to the file which contains the execution data. -->
                            <destFile>${project.build.directory}/coverage-reports/jacoco-ut-${testCoverageType}.exec
                            </destFile>
                            <!-- Sets the name of the property containing the settings for JaCoCo
                                runtime agent. -->
                            <propertyName>surefireArgLine</propertyName>
                        </configuration>

                    </execution>
                    <!-- Ensures that the code coverage report for unit tests is created
                        after unit tests have been run. -->
                    <execution>
                        <id>post-unit-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the path to the file which contains the execution data. -->
                            <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
                            <!-- Sets the output directory for the code coverage report. -->
                            <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>merge-results</id>
                        <phase>none</phase>
                        <goals>
                            <goal>merge</goal>
                        </goals>
                        <configuration>
                            <fileSets>
                                <fileSet>
                                    <!-- path refers to artifact download folder structure in maven.yml -->
                                    <directory>${project.build.directory}/coverage-reports/</directory>
                                    <includes>
                                        <include>jacoco-ut-jdk8.exec</include>
                                        <include>jacoco-ut-jdk9.exec</include>
                                        <include>jacoco-ut-integrationtest.exec</include>
                                    </includes>
                                </fileSet>
                            </fileSets>
                            <destFile>${project.build.directory}/coverage-reports/aggregated.exec</destFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <!-- Sets the VM argument line used when unit tests are run. -->
                    <argLine>-Xmx4096M ${surefireArgLine}</argLine>
                    <groups>${testcase.groups}</groups>
                    <trimStackTrace>false</trimStackTrace>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>3.0.0-M6</version>
                <configuration>
                    <showSuccess>false</showSuccess>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <groupId>org.apache.maven.plugins</groupId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <fixTags>author</fixTags>
                    <force>true</force>
                    <fixFieldComment>false</fixFieldComment>
                    <fixMethodComment>false</fixMethodComment>
                </configuration>
            </plugin>
            <!-- check headers -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>1.16</version>
                <configuration>
                    <failOnMissingHeader>${licence-check.failOnMissingHeader}</failOnMissingHeader>
                    <failOnNotUptodateHeader>${licence-check.failOnMissingHeader}</failOnNotUptodateHeader>
                    <inceptionYear>1997</inceptionYear>
                    <addJavaLicenseAfterPackage>true</addJavaLicenseAfterPackage>
                    <licenseName>lgpl_v2_1</licenseName>
                    <organizationName>Raja Vallée-Rai and others</organizationName>
                    <roots>
                        <root>sootup.java.analysis/src/main/java</root>
                        <root>sootup.callgraph/src/main/java</root>
                        <root>sootup.core/src/main/java</root>
                        <root>sootup.java.examples/src/main/java</root>
                        <root>sootup.java.bytecode/src/main/java</root>
                        <root>sootup.java.core/src/main/java</root>
                        <root>sootup.java.sourcecode/src/main/java</root>
                        <root>sootup.jimple.parser/src/main/java</root>
                        <root>sootup.tests/src/main/java</root>
                    </roots>
                </configuration>
                <executions>
                    <execution>
                        <id>license-check</id>
                        <goals>
                            <goal>check-file-header</goal>
                        </goals>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4j-simple.version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${apache-commons.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${apache-commons-io.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>
        <!-- testing -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- adds `@Nullable` and `@Nonnull` annotations -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
        </dependency>
    </dependencies>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

</project>
