<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2020 Richard Hauswald - https://quantummaid.de/.
  ~
  ~ Licensed to the Apache Software Foundation (ASF) under one
  ~ or more contributor license agreements.  See the NOTICE file
  ~ distributed with this work for additional information
  ~ regarding copyright ownership.  The ASF licenses this file
  ~ to you under the Apache License, Version 2.0 (the
  ~ "License"); you may not use this file except in compliance
  ~ with the License.  You may obtain a copy of the License at
  ~
  ~   http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->
<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.quantummaid</groupId>
    <artifactId>quantummaid-opensource-parent</artifactId>
    <version>0.9.42</version>
    <packaging>pom</packaging>

    <name>QuantumMaid OpenSource java standards</name>
    <description>
        This parent pom is supposed to be used as a parent for all QuantumMaid open source projects to reliably enable
        the enforcement of java standards like library blacklisting, code style rules, and more.
    </description>
    <url>https://github.com/quantummaid/quantummaid-opensource-parent</url>
    <organization>
        <name>Richard Hauswald</name>
        <url>https://www.quantummaid.de</url>
    </organization>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICmaven-compiler-pluginENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Richard Hauswald</name>
            <email>richard.hauswald@quantummaid.de</email>
            <organization>Richard Hauswald</organization>
            <organizationUrl>https://www.quantummaid.de</organizationUrl>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/quantummaid/quantummaid-opensource-parent</url>
        <connection>scm:git:git://github.com/quantummaid/quantummaid-opensource-parent.git</connection>
        <developerConnection>scm:git:git@github.com:quantummaid/quantummaid-opensource-parent.git</developerConnection>
    </scm>
    <distributionManagement>
        <repository>
            <uniqueVersion>false</uniqueVersion>
            <id>quantummaid.opensource.sonatype.staging</id>
            <name>Sonatype Staging</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
            <layout>default</layout>
        </repository>
    </distributionManagement>

    <properties>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.source.skip>true</maven.source.skip>
        <maven.javadoc.skip>true</maven.javadoc.skip>
        <sonar.skip>true</sonar.skip>

        <maven-enforcer-plugin-version>3.0.0-M3</maven-enforcer-plugin-version>
        <maven-source-plugin-version>3.2.1</maven-source-plugin-version>
        <maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version>
        <maven-source-plugin-version>3.2.1</maven-source-plugin-version>
        <maven-javadoc-plugin-version>3.2.0</maven-javadoc-plugin-version>
        <maven-jar-plugin-version>3.2.0</maven-jar-plugin-version>
        <maven-clean-plugin-version>3.1.0</maven-clean-plugin-version>
        <maven-install-plugin-version>3.0.0-M1</maven-install-plugin-version>
        <maven-deploy-plugin-version>3.0.0-M1</maven-deploy-plugin-version>
        <maven-site-plugin-version>3.9.0</maven-site-plugin-version>
        <maven-resources-plugin-version>3.1.0</maven-resources-plugin-version>
        <versions-maven-plugin-version>2.7</versions-maven-plugin-version>
        <documaid-version>0.9.26</documaid-version>
        <maven-gpg-plugin-version>1.6</maven-gpg-plugin-version>
        <nexus-staging-maven-plugin-version>1.6.8</nexus-staging-maven-plugin-version>
        <maven-surefire-plugin-version>3.0.0-M5</maven-surefire-plugin-version>
        <spotbugs-maven-plugin-version>4.0.4</spotbugs-maven-plugin-version>
        <spotbugs-maven-plugin-spotbugs-dependency-version>4.0.5</spotbugs-maven-plugin-spotbugs-dependency-version>
        <maven-checkstyle-plugin-version>3.1.1</maven-checkstyle-plugin-version>
        <maven-checkstyle-puppycrawl-plugin-version>8.33</maven-checkstyle-puppycrawl-plugin-version>
        <owasp-dependency-check-maven-version>5.3.2</owasp-dependency-check-maven-version>
        <sonar-maven-plugin-version>3.7.0.1746</sonar-maven-plugin-version>
        <jacobo-maven-plugin-version>0.8.5</jacobo-maven-plugin-version>

        <dependency-update-file-checksum>a949b51c3f94b8f3e02a109cd954d9a5</dependency-update-file-checksum>
        <plugin-update-file-checksum>915baffd77985e9da0d3cfee67e149eb</plugin-update-file-checksum>

        <sonar.organization>quantummaid</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.7.0-M1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin-version}</version>
                    <configuration>
                        <showWarnings>true</showWarnings>
                        <showDeprecation>true</showDeprecation>
                        <failOnError>true</failOnError>
                        <release>${java.version}</release>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <debug>true</debug>
                        <parameters>true</parameters>
                        <compilerArgs>
                            <arg>-Xlint:all</arg>
                            <arg>-Xlint:-processing</arg>
                            <arg>-Xlint:-serial</arg>
                        </compilerArgs>
                    </configuration>
                </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</goal>
                            </goals>
                            <phase>package</phase>
                        </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>
                            <phase>package</phase>
                            <configuration>
                                <quiet>true</quiet>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${versions-maven-plugin-version}</version>
                    <executions>
                        <execution>
                            <id>WriteDependencyUpdatesIntoFile</id>
                            <phase>generate-test-sources</phase>
                            <goals>
                                <goal>display-dependency-updates</goal>
                            </goals>
                            <configuration>
                                <allowSnapshots>false</allowSnapshots>
                                <outputFile>target/dependency-updates.txt</outputFile>
                                <outputEncoding>${project.build.sourceEncoding}</outputEncoding>
                                <rulesUri>file:///${project.basedir}/src/test/dependencies/ignoredVersionUpdates.xml</rulesUri>
                            </configuration>
                        </execution>
                        <execution>
                            <id>WritePluginUpdatesIntoFile</id>
                            <phase>generate-test-sources</phase>
                            <goals>
                                <goal>display-plugin-updates</goal>
                            </goals>
                            <configuration>
                                <allowSnapshots>false</allowSnapshots>
                                <outputFile>target/plugin-updates.txt</outputFile>
                                <outputEncoding>${project.build.sourceEncoding}</outputEncoding>
                                <rulesUri>file:///${project.basedir}/src/test/dependencies/ignoredVersionUpdates.xml</rulesUri>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven-enforcer-plugin-version}</version>
                    <executions>
                        <execution>
                            <id>enforce-checksum</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <phase>verify</phase>
                            <configuration>
                                <rules>
                                    <requireMavenVersion>
                                        <version>3.6</version>
                                    </requireMavenVersion>
                                    <requireFileChecksum>
                                        <message>Outdated dependencies detected</message>
                                        <file>target/dependency-updates.txt</file>
                                        <checksum>${dependency-update-file-checksum}</checksum>
                                        <type>md5</type>
                                    </requireFileChecksum>
                                    <requireFileChecksum>
                                        <message>Outdated plugins detected</message>
                                        <file>target/plugin-updates.txt</file>
                                        <checksum>${plugin-update-file-checksum}</checksum>
                                        <type>md5</type>
                                    </requireFileChecksum>
                                </rules>
                                <fail>true</fail>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>de.quantummaid</groupId>
                    <artifactId>documaid</artifactId>
                    <version>${documaid-version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>validate</goal>
                            </goals>
                            <phase>verify</phase>
                        </execution>
                    </executions>
                </plugin>
                <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>install</phase>
                            <goals>
                                <goal>sign</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>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <serverId>nexus</serverId>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        <autoDropAfterRelease>true</autoDropAfterRelease>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>tidy-maven-plugin</artifactId>
                    <version>1.1.0</version>
                    <executions>
                        <execution>
                            <id>validate</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>${spotbugs-maven-plugin-version}</version>
                    <configuration>
                        <includeTests>true</includeTests>
                        <trace>true</trace>
                        <effort>Max</effort>
                        <threshold>low</threshold>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>test</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>com.github.spotbugs</groupId>
                            <artifactId>spotbugs</artifactId>
                            <version>${spotbugs-maven-plugin-spotbugs-dependency-version}</version>
                        </dependency>
                    </dependencies>
                </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>${maven-checkstyle-puppycrawl-plugin-version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>checkCodeStyle</id>
                            <goals>
                                <goal>check</goal>
                            </goals>
                            <phase>process-test-classes</phase>
                            <configuration>
                                <configLocation>
                                    https://raw.githubusercontent.com/quantummaid/quantummaid-opensource-parent/master/checkstyle/checkstyle.xml
                                </configLocation>
                                <encoding>UTF-8</encoding>
                                <consoleOutput>true</consoleOutput>
                                <failOnViolation>true</failOnViolation>
                                <violationSeverity>info</violationSeverity>
                                <includeTestSourceDirectory>true</includeTestSourceDirectory>
                                <includes>**\/*.java,**\/*.xml,**\/*.properties</includes>
                                <testSourceDirectories>
                                    <testSourceDirectory>${project.build.testSourceDirectory}
                                    </testSourceDirectory>
                                    <testSourceDirectory>${project.basedir}/src/test/pmd</testSourceDirectory>
                                    <testSourceDirectory>${project.basedir}/src/test/checkstyle
                                    </testSourceDirectory>
                                </testSourceDirectories>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <version>${owasp-dependency-check-maven-version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                            <phase>verify</phase>
                            <configuration>
                                <failBuildOnAnyVulnerability>true</failBuildOnAnyVulnerability>
                                <suppressionFiles>
                                    <suppressionFile>src/test/dependencies/ignoredVulnerableVersion.xml</suppressionFile>
                                </suppressionFiles>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonarsource.scanner.maven</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>${sonar-maven-plugin-version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>sonar</goal>
                            </goals>
                            <phase>verify</phase>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacobo-maven-plugin-version}</version>
                    <executions>
                        <execution>
                            <id>prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>report</id>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>prepareForMavenCentral</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>prepareForMavenCentral</name>
                </property>
            </activation>
            <properties>
                <maven.compiler.failOnWarning>true</maven.compiler.failOnWarning>
                <maven.source.skip>false</maven.source.skip>
                <maven.javadoc.skip>false</maven.javadoc.skip>
                <testMode>RELEASE</testMode>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>tidy-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>de.quantummaid</groupId>
                        <artifactId>documaid</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.owasp</groupId>
                        <artifactId>dependency-check-maven</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>deployToMavenCentral</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>deployToMavenCentral</name>
                </property>
            </activation>
            <properties>
                <maven.compiler.failOnWarning>true</maven.compiler.failOnWarning>
                <maven.source.skip>false</maven.source.skip>
                <maven.javadoc.skip>false</maven.javadoc.skip>
                <testMode>RELEASE</testMode>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>tidy-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>de.quantummaid</groupId>
                        <artifactId>documaid</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.owasp</groupId>
                        <artifactId>dependency-check-maven</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>Tests</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>skipTests</name>
                    <value>!true</value>
                </property>
            </activation>
            <properties>
                <maven.compiler.failOnWarning>true</maven.compiler.failOnWarning>
                <maven.source.skip>false</maven.source.skip>
                <maven.javadoc.skip>false</maven.javadoc.skip>
                <testMode>NORMAL</testMode>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                    </plugin>
                </plugins>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <version>${maven-surefire-plugin-version}</version>
                            <configuration>
                                <trimStackTrace>false</trimStackTrace>
                                <includes>
                                    <include>**/*Specs.java</include>
                                    <include>**/*Test.java</include>
                                </includes>
                                <systemPropertyVariables>
                                    <testMode>${testMode}</testMode>
                                </systemPropertyVariables>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>StaticCodeAnalysisTests</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>skipTests</name>
                    <value>!true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonarsource.scanner.maven</groupId>
                        <artifactId>sonar-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sonar</id>
            <activation>
                <property>
                    <name>sonar</name>
                </property>
            </activation>
            <properties>
                <sonar.skip>false</sonar.skip>
            </properties>
        </profile>
    </profiles>
</project>
