<?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>de.bund.bva.isyfact</groupId>
    <artifactId>isyfact-standards</artifactId>
    <version>2.2.2</version>
    <packaging>pom</packaging>

    <name>IsyFact-Standards (Module- &amp; Parent-POM)</name>
    <description>
        Die IsyFact-Standards bilden das architektonische, technologische und methodische
        Fundament der IsyFact. Sie umfassen allgemeingültige und wiederverwendbare Konzepte und
        Komponenten, die für die Entwicklung beliebiger Fachanwendungen relevant sind.
    </description>
    <url>http://isyfact.de</url>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>IsyFact-Team</name>
            <email>isyfact@bva.bund.de</email>
            <organization>Bundesverwaltungsamt (BVA)</organization>
            <organizationUrl>https://www.bva.bund.de</organizationUrl>
        </developer>
    </developers>

    <modules>
        <module>isyfact-standards-bom</module>
        <module>isyfact-products-bom</module>
        <module>isy-aufrufkontext</module>
        <module>isy-batchrahmen</module>
        <module>isy-datetime</module>
        <module>isy-exception-core</module>
        <module>isy-exception-sst</module>
        <module>isy-konfiguration</module>
        <module>isy-logging</module>
        <module>isy-persistence</module>
        <module>isy-polling</module>
        <module>isy-serviceapi-core</module>
        <module>isy-serviceapi-sst</module>
        <module>isy-sicherheit</module>
        <module>isy-sst-bridge</module>
        <module>isy-task</module>
        <module>isy-ueberwachung</module>
        <module>isy-util</module>
        <module>isy-sonderzeichen</module>
    </modules>

    <scm>
        <connection>scm:git:git://github.com/IsyFact/isyfact-standards.git</connection>
        <developerConnection>scm:git:ssh://github.com:IsyFact/isyfact-standards.git</developerConnection>
        <url>https://github.com/IsyFact/isyfact-standards</url>
    </scm>

    <properties>
        <!-- Build properties -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.compile.version>1.8</java.compile.version>

        <!-- maven-enforcer-plugin configuration -->
        <enforced.jdk.version>[1.8,1.9)</enforced.jdk.version>
        <enforced.maven.version>[3.1.1,4)</enforced.maven.version>

        <!-- Property is set by jacoco and user by surefire -->
        <maven.jacoco.argLine/>

        <!-- maven-surefire-plugin configuration -->
        <maven.surefire.argline>-Xmx1g -XX:MaxPermSize=256m -Dfile.encoding=${project.build.sourceEncoding} @{maven.jacoco.argLine}
        </maven.surefire.argline>


        <!-- Plugin versions used in several places -->
        <maven.enforcer.plugin.version>1.4.1</maven.enforcer.plugin.version>
        <maven.javadoc.plugin.version>2.10.4</maven.javadoc.plugin.version>
    </properties>

    <!-- TODO: Remove if Spotbug issues are fixed -->
    <dependencies>
        <dependency>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs-annotations</artifactId>
            <version>4.2.1</version>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <!-- License directory -->
                <directory>license</directory>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven.enforcer.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>enforce-maven</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireJavaVersion>
                                        <version>${enforced.jdk.version}</version>
                                    </requireJavaVersion>
                                    <requireMavenVersion>
                                        <version>${enforced.maven.version}</version>
                                    </requireMavenVersion>
                                </rules>
                            </configuration>
                        </execution>
                        <execution>
                            <id>enforce-dependency-convergence</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <dependencyConvergence/>
                                </rules>
                                <fail>true</fail>
                            </configuration>
                        </execution>
                        <execution>
                            <id>enforce-banned-dependencies</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <bannedDependencies>
                                        <excludes>
                                            <exclude>de.bund.bva.pliscommon:plis-*</exclude>
                                            <exclude>log4j:log4j</exclude>
                                        </excludes>
                                        <message>Verbotene Abhängigkeiten gefunden, für die neuere Entsprechungen
                                            (Group-ID: de.bund.bva.isyfact) existieren.
                                            Bitte dependency:tree prüfen und entsprechend exkludieren.
                                        </message>
                                    </bannedDependencies>
                                </rules>
                                <fail>true</fail>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>3.1.1</version>
                    <configuration>
                        <configLocation>checkstyle.config.xml</configLocation>
                        <encoding>UTF-8</encoding>
                        <consoleOutput>true</consoleOutput>
                        <failsOnError>true</failsOnError>
                        <linkXRef>false</linkXRef>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>de.bund.bva.isyfact</groupId>
                            <artifactId>isy-checkstyle-config</artifactId>
                            <version>0.1.0</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>validate</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>tidy-maven-plugin</artifactId>
                    <version>1.1.0</version>
                    <executions>
                        <execution>
                            <id>check-pom-style</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.6</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                            <configuration>
                                <propertyName>maven.jacoco.argLine</propertyName>
                            </configuration>
                        </execution>
                        <execution>
                            <id>report</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.19.1</version>
                    <configuration>
                        <argLine>${maven.surefire.argline}</argLine>
                        <systemPropertyVariables>
                            <user.language>de</user.language>
                            <user.country>DE</user.country>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>4.1.3</version>
                    <configuration>
                        <effort>Max</effort>
                        <threshold>high</threshold>
                        <xmlOutput>true</xmlOutput>
                    </configuration>
                    <executions>
                        <execution>
                            <id>execute-spot-bugs</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>${java.compile.version}</source>
                    <target>${java.compile.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc.plugin.version}</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <charset>${project.build.sourceEncoding}</charset>
                    <additionalparam>-Xdoclint:none</additionalparam>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.3</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.6</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.0.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>javancss-maven-plugin</artifactId>
                <version>2.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.7.1</version>
            </plugin>
<!-- Quality Gates 1 -->
            <!-- Check if all POMs are formatted according to the Maven-Team-Standard. -->
            <!-- Use mvn tidy:pom in order to tidy up the POM. -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tidy-maven-plugin</artifactId>
            </plugin>
            <!-- Check java and maven version. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.0.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.19.1</version>
            </plugin>
            <!-- Create checkstyle report -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
            <!-- Create javadocs. Providing the encoding ensures correct character representation in the javadocs. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc.plugin.version}</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <charset>${project.build.sourceEncoding}</charset>
                    <additionalparam>-Xdoclint:none</additionalparam>
                </configuration>
            </plugin>
            <!-- Allows cross-reference of the project's sources in maven reports. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>2.5</version>
            </plugin>
            <!-- Report bug patterns. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.6</version>
                <configuration>
                    <sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
                    <targetJdk>${java.compile.version}</targetJdk>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>3.0.4</version>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <!-- Profile to avoid SNAPSHOT-versions in releases. -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-no-snapshots</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireReleaseDeps>
                                            <message>Keine SNAPSHOT-Abhängigkeiten erlaubt!</message>
                                        </requireReleaseDeps>
                                        <requireReleaseVersion>
                                            <message>Keine SNAPSHOT-Versionen erlaubt!</message>
                                        </requireReleaseVersion>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!-- Moves the license files in APIDocs, if present. -->
            <id>copyLicenseFiles</id>
            <activation>
                <file>
                    <exists>license</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>1.7</version>
                        <executions>
                            <execution>
                                <id>license-to-apidoc</id>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <target>
                                        <copy todir="${project.build.directory}/apidocs">
                                            <fileset dir="${basedir}/license" includes="*"/>
                                        </copy>
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>centralRelease</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>JARsigning</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jarsigner-plugin</artifactId>
                        <version>1.4</version>
                        <executions>
                            <execution>
                                <id>sign</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <keystore>${sign.keystore}</keystore>
                            <alias>${sign.alias}</alias>
                            <storepass>${sign.storepass}</storepass>
                            <tsa>http://timestamp.digicert.com</tsa>
                            <arguments>
                                <argument>${sign.proxyhost}</argument>
                                <argument>${sign.proxyport}</argument>
                            </arguments>
                            <verbose>true</verbose>
                            <certs>true</certs>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>GPGsigning</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <keyname>${gpg.keyname}</keyname>
                            <passphrase>${gpg.passphrase}</passphrase>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>centralmavenrepo</id>
            <activation>
                <property>
                    <name>centraldeploy</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
            </properties>
            <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>
        </profile>
        <profile>
            <id>internalmavenrepo</id>
            <activation>
                <property>
                    <name>!centraldeploy</name>
                </property>
            </activation>
            <properties>
            </properties>
            <distributionManagement>
                <repository>
                    <id>repository</id>
                    <name>Repository</name>
                    <url>${deploy-url-release}</url>
                </repository>
                <snapshotRepository>
                    <id>repository</id>
                    <name>Repository</name>
                    <url>${deploy-url-snapshot}</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
        <profile>
            <id>JDK-11-for-8</id>
            <activation>
                <jdk>[11,12)</jdk>
                <property>
                    <name>!for11</name>
                </property>
            </activation>
            <properties>
                <enforced.jdk.version>[11,12)</enforced.jdk.version>
                <maven.javadoc.plugin.version>3.1.1</maven.javadoc.plugin.version>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven.javadoc.plugin.version}</version>
                        <configuration>
                            <source>8</source>
                            <encoding>${project.build.sourceEncoding}</encoding>
                            <charset>${project.build.sourceEncoding}</charset>
                            <doclint>none</doclint>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>JDK-11-for-11</id>
            <activation>
                <jdk>[11,12)</jdk>
                <property>
                    <name>for11</name>
                </property>
            </activation>
            <properties>
                <enforced.jdk.version>[11,12)</enforced.jdk.version>
                <maven.javadoc.plugin.version>3.1.1</maven.javadoc.plugin.version>
                <java.compile.version>11</java.compile.version>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven.javadoc.plugin.version}</version>
                        <configuration>
                            <source>11</source>
                            <encoding>${project.build.sourceEncoding}</encoding>
                            <charset>${project.build.sourceEncoding}</charset>
                            <doclint>none</doclint>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
