<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <groupId>org.faktorips</groupId>
    <artifactId>faktorips-runtime-addons</artifactId>
    <version>21.12.0-rfinal</version>
    <packaging>pom</packaging>

    <properties>
        <git.user>${user.name}</git.user>
        <jdk.version>1.8</jdk.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- <faktorips.version>${project.version}</faktorips.version> -->
        <faktorips.version>21.12.0</faktorips.version>
        <faktorips-runtime.version>${faktorips.version}</faktorips-runtime.version>

        <checkstyle.skip>false</checkstyle.skip>

        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven.compiler.parameters>true</maven.compiler.parameters>
        <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
        <spotbugs-maven-plugin.version>4.5.0.0</spotbugs-maven-plugin.version>
        <maven-release-plugin.version>3.0.0-M4</maven-release-plugin.version>
        <maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
        <checkstyle.version>9.2</checkstyle.version>
        <revapi-maven-plugin.version>0.14.6</revapi-maven-plugin.version>
        <revapi-maven-java.version>0.26.1</revapi-maven-java.version>
        <maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version>
        <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>

        <javadoc.doclint.string>accessibility,html,reference,syntax,-missing</javadoc.doclint.string>
        <javadoc.failOnError>true</javadoc.failOnError>
        <javadoc.detectJavaApiLink>true</javadoc.detectJavaApiLink>

        <jaxb-impl.version>2.4.0-b180830.0438</jaxb-impl.version>
        <javax.activation.version>1.2.0</javax.activation.version>
        <jaxb-api.version>2.4.0-b180830.0359</jaxb-api.version>
        <checkstyle.header.file>${project.basedir}/checkstyle.java.header</checkstyle.header.file>
    </properties>

    <name>Faktor-IPS Runtime - Addons Parent Pom</name>
    <description>Parent Pom for Runtime Addons for Faktor-IPS</description>
    <url>http://faktorzehn.org</url>


    <scm>
        <connection>scm:git:ssh://${git.user}@projekte.faktorzehn.de/projekte/faktorips/faktorips.runtime-addons.git</connection>
        <url>https://projekte.faktorzehn.de/projekte/faktorips/faktorips.runtime-addons.git</url>
        <tag>v21.12.0-rfinal</tag>
    </scm>


    <distributionManagement>
        <repository>
            <id>releases</id>
            <name>Faktor Zehn Releases</name>
            <url>https://nexus.faktorzehn.de/content/repositories/releases/</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <name>Faktor Zehn Snapshots</name>
            <url>https://nexus.faktorzehn.de/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <licenses>
        <license>
            <name>GNU Affero General Public License Version 3 with additional permissions</name>
            <url>http://www.gnu.org/licenses/agpl-3.0-standalone.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>dirmeier</id>
            <name>Cornelius Dirmeier</name>
            <email>Cornelius.Dirmeier@faktorzehn.de</email>
        </developer>
        <developer>
            <id>schwering</id>
            <name>Daniel Schwering</name>
            <email>Daniel.Schwering@faktorzehn.de</email>
        </developer>
    </developers>

    <!-- These are all modules that are included in the Faktor-IPS build -->

    <modules>
        <module>faktorips-runtime-productdataprovider-ejbclient</module>
        <module>faktorips-runtime-productdataservice</module>
        <module>faktorips-runtime-productdataservice-common</module>
        <module>faktorips-runtime-productdataprovider-integrationtest</module>
    </modules>

    <build>
        <resources>
            <resource>
                <directory>${project.basedir}</directory>
                <includes>
                    <include>LICENSE.txt</include>
                    <include>agpl-3.0.txt</include>
                </includes>
            </resource>
        </resources>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <target>${jdk.version}</target>
                        <source>${jdk.version}</source>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.faktorips</groupId>
                    <artifactId>faktorips-maven-plugin</artifactId>
                    <version>${faktorips.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.revapi</groupId>
                    <artifactId>revapi-maven-plugin</artifactId>
                    <version>${revapi-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${maven-checkstyle-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>${checkstyle.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>${spotbugs-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.revapi</groupId>
                <artifactId>revapi-maven-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.revapi</groupId>
                        <artifactId>revapi-java</artifactId>
                        <version>${revapi-maven-java.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <versionFormat>\d+\.\d+(\.\d+)?</versionFormat>
                    <analysisConfigurationFiles>
                        <configurationFile>
                            <path>${project.basedir}/api-changes.json</path>
                            <roots>
                                <root>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</root>
                                <root>all-versions</root>
                            </roots>
                        </configurationFile>
                    </analysisConfigurationFiles>
                    <failOnMissingConfigurationFiles>false</failOnMissingConfigurationFiles>
                    <analysisConfiguration>
                        <!-- over all configuration - https://revapi.org/modules/revapi-java/index.html -->
                        <revapi.java>
                            <checks>
                                <nonPublicPartOfAPI>
                                    <reportUnchanged>false</reportUnchanged>
                                </nonPublicPartOfAPI>
                            </checks>
                        </revapi.java>
                        <revapi.semver.ignore>
                            <enabled>true</enabled>
                            <passThroughDifferences>
                                <item>java.class.nonPublicPartOfAPI</item>
                            </passThroughDifferences>
                        </revapi.semver.ignore>
                    </analysisConfiguration>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <source>${jdk.version}</source>
                    <doclint>${javadoc.doclint.string}</doclint>
                    <detectJavaApiLink>${javadoc.detectJavaApiLink}</detectJavaApiLink>
                    <failOnError>${javadoc.failOnError}</failOnError>
                    <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>
                    </tags>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <configuration>
                    <configLocation>checkstyle/fips_checks.xml</configLocation>
                    <suppressionsLocation>checkstyle/fips_suppressions.xml</suppressionsLocation>
                    <suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
                    <propertyExpansion>config_loc=/checkstyle/</propertyExpansion>
                    <skip>${checkstyle.skip}</skip>
                    <linkXRef>false</linkXRef>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <configuration>
                    <xmlOutput>true</xmlOutput>
                    <threshold>Low</threshold>
                    <jvmArgs>-Xmx1g</jvmArgs>
                </configuration>
                <executions>
                    <execution>
                        <id>spotbugs</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>spotbugs</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <extensions>
            <!-- Include this build artifact to every child's classpath. This is used for example by the checkstyle or spotbugs configuration -->
            <extension>
                <groupId>org.faktorips</groupId>
                <artifactId>org.faktorips.build.config</artifactId>
                <version>1.2.5</version>
            </extension>
        </extensions>
    </build>

    <profiles>
        <!-- Unlike java8 which includes JAXB, jdk11 needs JAXB dependencies. With this profile you can use jdk11 and still use source and target 1.8 in the maven-compiler-plugin to create class files with a java8 major version of 52 -->
        <profile>
            <activation>
                <jdk>[11,)</jdk>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-impl</artifactId>
                    <version>${jaxb-impl.version}</version>
                </dependency>
                <dependency>
                    <groupId>javax.xml.bind</groupId>
                    <artifactId>jaxb-api</artifactId>
                    <version>${jaxb-api.version}</version>
                    <scope>provided</scope>
                </dependency>
                <!-- com/sun/istack/Pool was removed from jaxb version > 2.3.0, we use jaxb 2.4.0 for java11 compatibility -->
                <dependency>
                    <groupId>com.sun.istack</groupId>
                    <artifactId>istack-commons-runtime</artifactId>
                    <version>2.24</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>deployToNexus</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <distributionManagement>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
                </repository>
            </distributionManagement>
            <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>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>