<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2020 the original author or authors.
  ~ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  ~
  ~ This Source Code Form is subject to the terms of the Mozilla Public
  ~ License, v. 2.0. If a copy of the MPL was not distributed with this
  ~ file, You can obtain one at https://mozilla.org/MPL/2.0/.
  -->

<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>science.aist</groupId>
    <artifactId>jack</artifactId>
    <version>2.2.0</version>

    <properties>
        <!-- versions -->
        <seshat.version>1.0.0</seshat.version>
        <maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version>
        <maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven-scm-publish-plugin.version>3.0.0</maven-scm-publish-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
        <lombok.version>1.18.10</lombok.version>
        <spring-core.version>5.2.5.RELEASE</spring-core.version>
        <log4j.version>2.12.1</log4j.version>

        <!-- set platform source encoding -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <commons-fileupload.version>1.4</commons-fileupload.version>

        <!-- set java version for maven compiler-->
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <!-- sonar variables -->
        <jacoco.plugin.version>0.8.5</jacoco.plugin.version>
        <sonar-jacoco-listeners.version>5.14.0.18788</sonar-jacoco-listeners.version>
        <maven-site-plugin.version>3.8.2</maven-site-plugin.version>
        <wagon-webdav-jackrabbit.version>3.3.4</wagon-webdav-jackrabbit.version>
        <maven-clover-plugin.version>2.4</maven-clover-plugin.version>
        <maven-project-info-reports-plugin.version>3.0.0</maven-project-info-reports-plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.14.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>science.aist.seshat</groupId>
            <artifactId>api</artifactId>
            <version>${seshat.version}</version>
        </dependency>
        <dependency>
            <groupId>science.aist.seshat</groupId>
            <artifactId>log4j2</artifactId>
            <version>${seshat.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring-core.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <scm>
        <url>https://aist.fh-hagenberg.at/git/Development/jack</url>
        <connection>scm:git:ssh://git@aist.fh-hagenberg.at:2224/Development/jack.git</connection>
        <developerConnection>scm:git:ssh://git@aist.fh-hagenberg.at:2224/Development/jack.git</developerConnection>
        <tag>jack-2.2.0</tag>
    </scm>
    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
        <site>
            <id>javadoc</id>
            <url>scm:git:ssh://git@github.com/FHOOEAIST/jack.git</url>
        </site>
    </distributionManagement>

    <name>Java AIST Class Kit</name>
    <description>A collection of useful Java extensions</description>
    <url>https://github.com/FHOOEAIST/jack</url>
    <licenses>
        <license>
            <name>Mozilla Public License (MPL) version 2.0</name>
            <url>https://www.mozilla.org/en-US/MPL/2.0/</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <issueManagement>
        <system>Gitlab</system>
        <url>https://aist.fh-hagenberg.at/git/Development/jack</url>
    </issueManagement>
    <ciManagement>
        <system>Jenkins</system>
        <url>https://aist-intern.fh-hagenberg.at/jenkins/job/jack/</url>
    </ciManagement>
    <developers>
        <developer>
            <id>AIST</id>
            <name>Advanced Information Systems and Technology</name>
            <email>contact@aist.science</email>
            <roles>
                <role>Research Group</role>
            </roles>
            <url>http://aist.science</url>
            <organization>University of Applied Sciences Upper Austria</organization>
            <organizationUrl>https://www.fh-ooe.at/</organizationUrl>
        </developer>
    </developers>
    <organization>
        <name>Advanced Information Systems and Technology</name>
        <url>http://aist.science</url>
    </organization>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <systemPropertyVariables>
                        <seshat.loglevel>DEBUG</seshat.loglevel>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${maven-project-info-reports-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <doclint>none</doclint>
                    <additionalJOptions>
                        <additionalJOption>--no-module-directories</additionalJOption>
                    </additionalJOptions>
                </configuration>
                <reportSets>
                    <reportSet><!-- by default, id = "default" -->
                        <reports><!-- select non-aggregate reports -->
                            <report>javadoc</report>
                            <report>test-javadoc</report>
                        </reports>
                    </reportSet>
                    <reportSet><!-- aggregate reportSet, to define in poms having modules -->
                        <id>aggregate</id>
                        <inherited>false</inherited><!-- don't run aggregate in child modules -->
                        <reports>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <compilerArgs>
                        <arg>-Xlint</arg>
                    </compilerArgs>
                    <release>11</release>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${lombok.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-publish-plugin</artifactId>
                <version>${maven-scm-publish-plugin.version}</version>
                <configuration>
                    <scmBranch>site</scmBranch>
                </configuration>
            </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>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <doclint>all</doclint>
                </configuration>
                <executions>
                    <execution>
                        <id>aggregate</id>
                        <goals>
                            <goal>aggregate-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${maven-site-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.wagon</groupId>
                        <artifactId>wagon-webdav-jackrabbit</artifactId>
                        <version>${wagon-webdav-jackrabbit.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>os-release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--no-permission-warning</arg>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                        <arg>${arguments}</arg>
                                    </gpgArguments>
                                </configuration>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-release-plugin</artifactId>
                            <version>${maven-release-plugin.version}</version>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>

        <profile>
            <id>sonar-coverage</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.jacoco</groupId>
                            <artifactId>jacoco-maven-plugin</artifactId>
                            <version>${jacoco.plugin.version}</version>
                        </plugin>
                    </plugins>
                </pluginManagement>

                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>${maven-dependency-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>copy-dependencies</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <configuration>
                                    <!-- configure the plugin here -->
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <configuration>
                            <append>true</append>
                        </configuration>
                        <executions>
                            <execution>
                                <id>agent-for-ut</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <destFile>${project.jacoco.ut.reportPath}</destFile>
                                    <propertyName>jacoco.agent.ut.arg</propertyName>
                                    <append>true</append>
                                </configuration>
                            </execution>
                            <execution>
                                <id>agent-for-it</id>
                                <goals>
                                    <goal>prepare-agent-integration</goal>
                                </goals>
                                <configuration>
                                    <destFile>${project.jacoco.it.reportPath}</destFile>
                                    <propertyName>jacoco.agent.it.arg</propertyName>
                                    <append>true</append>
                                </configuration>
                            </execution>
                            <execution>
                                <id>jacoco-site</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven-surefire-plugin.version}</version>
                        <configuration>
                            <argLine>${jacoco.agent.ut.arg}</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.sonarsource.java</groupId>
                    <artifactId>sonar-jacoco-listeners</artifactId>
                    <version>${sonar-jacoco-listeners.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>
