<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2021 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>documaid</artifactId>
    <version>0.9.45</version>
    <packaging>maven-plugin</packaging>

    <name>DocuMaid</name>
    <description>
        DocuMaid is an easy to use plugin to reference code in your documentation and to validate that those links
        always exist.
        And you also can insert your current project's version anywhere.
    </description>
    <url>https://github.com/quantummaid/documaid</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>

    <prerequisites>
        <maven>3.3.9</maven>
    </prerequisites>

    <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>nexus</id>
            <name>Sonatype Staging</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
            <layout>default</layout>
        </repository>
    </distributionManagement>

    <properties>
        <kotlin.version>1.4.0</kotlin.version>
        <klint-plugin-version>1.9.0</klint-plugin-version>
        <kotlin.version>1.4.32</kotlin.version>
        <maven-clean-plugin-version>3.1.0</maven-clean-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-resources-plugin-version>3.2.0</maven-resources-plugin-version>
        <maven-jar-plugin-version>3.2.0</maven-jar-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-plugin-plugin-version>3.6.1</maven-plugin-plugin-version>
        <maven-site-plugin-version>3.9.1</maven-site-plugin-version>
        <maven-surfire-plugin-version>3.0.0-M5</maven-surfire-plugin-version>
        <maven-enforcer-plugin-version>3.0.0-M3</maven-enforcer-plugin-version>
        <maven-gpg-plugin-version>3.0.1</maven-gpg-plugin-version>
        <versions-maven-plugin-version>2.8.1</versions-maven-plugin-version>
        <owasp-dependency-check-plugin-version>6.1.6</owasp-dependency-check-plugin-version>
        <tidy-maven-plugin-version>1.1.0</tidy-maven-plugin-version>
        <nexus-staging-maven-plugin-version>1.6.8</nexus-staging-maven-plugin-version>
        <junit-version>5.8.0-M1</junit-version>
        <maven-plugin-dependency-version>3.8.1</maven-plugin-dependency-version>
        <maven-core-dependency-version>3.8.1</maven-core-dependency-version>
        <maven-annotations-dependency-version>3.6.1</maven-annotations-dependency-version>
        <license-maven-plugin-version>4.0.rc2</license-maven-plugin-version>
        <sonar-maven-plugin-version>3.7.0.1746</sonar-maven-plugin-version>
        <jacobo-maven-plugin-version>0.8.7</jacobo-maven-plugin-version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jvm-target-version>1.8</jvm-target-version>
        <sonar.organization>quantummaid</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>30.1.1-jre</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit-version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven-plugin-dependency-version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven-core-dependency-version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${maven-annotations-dependency-version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>${kotlin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-test</artifactId>
            <version>${kotlin.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-test-junit5</artifactId>
            <version>${kotlin.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
        <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${maven-plugin-plugin-version}</version>
                    <configuration>
                        <goalPrefix>documaid</goalPrefix>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default-descriptor</id>
                            <phase>process-classes</phase>
                        </execution>
                        <execution>
                            <id>generated-helpmojo</id>
                            <goals>
                                <goal>helpmojo</goal>
                            </goals>
                        </execution>
                    </executions>
                </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-deploy-plugin</artifactId>
                    <version>${maven-deploy-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-jar-plugin</artifactId>
                    <version>${maven-jar-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.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-plugin</artifactId>
                    <version>${kotlin.version}</version>
                    <configuration>
                        <jvmTarget>${jvm-target-version}</jvmTarget>
                        <args>
                            <arg>-Werror</arg>
                        </args>
                    </configuration>
                    <executions>
                        <execution>
                            <id>compile</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>test-compile</id>
                            <phase>test-compile</phase>
                            <goals>
                                <goal>test-compile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin-version}</version>
                    <configuration>
                        <source>8</source>
                        <target>8</target>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default-compile</id>
                            <phase>none</phase>
                        </execution>
                        <execution>
                            <id>default-testCompile</id>
                            <phase>none</phase>
                        </execution>
                        <execution>
                            <id>java-compile</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>java-test-compile</id>
                            <phase>test-compile</phase>
                            <goals>
                                <goal>testCompile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surfire-plugin-version}</version>
                    <configuration>
                        <includes>
                            <include>*Specs</include>
                        </includes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.github.gantsign.maven</groupId>
                    <artifactId>ktlint-maven-plugin</artifactId>
                    <version>${klint-plugin-version}</version>
                    <executions>
                        <execution>
                            <id>check</id>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </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>
                                    <requireFileChecksum>
                                        <message>Outdated dependencies detected</message>
                                        <file>target/dependency-updates.txt</file>
                                        <checksum>3c917f29727fcfb2b50ed3ccaad4a495</checksum>
                                        <type>md5</type>
                                    </requireFileChecksum>
                                    <requireFileChecksum>
                                        <message>Outdated plugins detected</message>
                                        <file>target/plugin-updates.txt</file>
                                        <checksum>dddf6ceaae24dd9a6356d4cdd6baeff3</checksum>
                                        <type>md5</type>
                                    </requireFileChecksum>
                                </rules>
                                <fail>true</fail>
                            </configuration>
                        </execution>
                    </executions>
                </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-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin-version}</version>
                    <configuration>
                        <keyname>developer@quantummaid.de</keyname>
                    </configuration>
                    <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.codehaus.mojo</groupId>
                    <artifactId>tidy-maven-plugin</artifactId>
                    <version>${tidy-maven-plugin-version}</version>
                    <executions>
                        <execution>
                            <id>validate</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <version>${owasp-dependency-check-plugin-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>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${license-maven-plugin-version}</version>
                    <configuration>
                        <header>copyright/Copyright-Header.txt</header>
                        <properties>
                            <license.year>2020</license.year>
                        </properties>
                        <includes>
                            <include>**/*.kt</include>
                            <include>**/*.java</include>
                        </includes>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </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.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.github.gantsign.maven</groupId>
                <artifactId>ktlint-maven-plugin</artifactId>
            </plugin>
            <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.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>deployToMavenCentral</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>deployToMavenCentral</name>
                </property>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>tidy-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.owasp</groupId>
                        <artifactId>dependency-check-maven</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>prepareForMavenCentral</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>prepareForMavenCentral</name>
                </property>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>tidy-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.owasp</groupId>
                        <artifactId>dependency-check-maven</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-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>
