<?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>science.aist</groupId>
    <artifactId>ocel-model</artifactId>
    <version>1.0.0</version>

    <properties>
        <testng.version>7.6.0</testng.version>
        <surefire.plugin.version>2.18.1</surefire.plugin.version>
        <maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <log4j.version>2.12.1</log4j.version>
        <lombok.version>1.18.24</lombok.version>
        <jaxb-api.version>2.4.0-b180830.0359</jaxb-api.version>
        <jaxb-runtime.version>2.3.3</jaxb-runtime.version>

        <!-- set platform source encoding -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <commons-fileupload.version>1.4</commons-fileupload.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>
        <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>
        <jaxb2-maven-plugin.version>2.5.0</jaxb2-maven-plugin.version>
        <build-helper-maven-plugin.version>3.1.0</build-helper-maven-plugin.version>

        <!-- sonar variables -->
        <jacoco.plugin.version>0.8.4</jacoco.plugin.version>
        <project.jacoco.ut.reportPath>${user.dir}/target/jacoco.exec</project.jacoco.ut.reportPath>
        <project.jacoco.it.reportPath>${user.dir}/target/jacoco-it.exec</project.jacoco.it.reportPath>
        <sonar.jacoco.reportPaths>${project.jacoco.ut.reportPath},${project.jacoco.it.reportPath}</sonar.jacoco.reportPaths>
        <sonar.java.libraries>${project.build.directory}/dependency</sonar.java.libraries>
        <sonar-jacoco-listeners.version>5.14.0.18788</sonar-jacoco-listeners.version>

    </properties>


    <scm>
        <connection>scm:git:git@github.com:FHOOEAIST/ocel-model.git</connection>
        <url>https://github.com/FHOOEAIST/ocel-model</url>
        <developerConnection>scm:git:git@github.com:FHOOEAIST/ocel-model.git</developerConnection>
        <tag>ocel-model-1.0.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/xes-model.git</url>
        </site>
    </distributionManagement>

    <name>OCEL Model</name>
    <description>Autogenerated OCEL Model</description>
    <url>https://github.com/FHOOEAIST/ocel-model</url>
    <organization>
        <name>Advanced Information Systems and Technology</name>
        <url>http://aist.science</url>
    </organization>
    <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>GitHub</system>
        <url>https://github.com/FHOOEAIST/ocel-model/issues</url>
    </issueManagement>
    <ciManagement>
        <system>Jenkins</system>
        <url>https://aist-intern.fh-hagenberg.at/jenkins/job/ocel-model/</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>

    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${testng.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>${jaxb-api.version}</version>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>${jaxb-runtime.version}</version>
        </dependency>
    </dependencies>

    <reporting>
        <plugins>
            <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>
                    <encoding>UTF-8</encoding>
                </configuration>
                <reportSets>
                    <reportSet><!-- by default, id = "default" -->
                        <reports><!-- select non-aggregate reports -->
                            <report>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-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-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>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <doclint>none</doclint>
                    <encoding>UTF-8</encoding>
                </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>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>${jaxb2-maven-plugin.version}</version>
                <!-- schema to java classes -->
                <executions>
                    <execution>
                        <id>xjc-ocel-model</id>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                        <configuration>
                            <!-- The default output directory is in target/generated-sources located which is perfectly fine, as there is no reason to keep all that
                            generated code in our git repository, especially when the generation is executed in only a few seconds -->
                            <packageName>science.aist.ocel.model</packageName>
                            <!-- location of the xsd schema that should be converted to java classes -->
                            <sources>
                                <source>src/main/resources/ocel.xsd</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>${build-helper-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>jaxb-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <!-- Use the same as defined in the jaxb2 plugin https://www.mojohaus.org/jaxb2-maven-plugin/Documentation/v2.2/xjc-mojo.html#outputDirectory -->
                                <source>${project.build.directory}/generated-sources/jaxb</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </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>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>${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>