<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  kotlin-maven-plugin-tools
  %%
  Copyright (C) 2018 GantSign Ltd.
  %%
  Licensed 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.
  #L%
  -->
<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>

  <parent>
    <groupId>com.github.gantsign.parent</groupId>
    <artifactId>kotlin-parent</artifactId>
    <version>3.3.0</version>
    <relativePath/>
  </parent>

  <groupId>com.github.gantsign.maven.plugin-tools</groupId>
  <artifactId>kotlin-maven-plugin-tools-parent</artifactId>
  <version>${revision}</version>

  <packaging>pom</packaging>

  <name>Kotlin Maven plugin Tools parent POM</name>
  <description>POM with shared configuration for the Kotlin Maven Plugin Tools project.</description>

  <modules>
    <module>kotlin-maven-plugin-tools</module>
  </modules>

  <properties>
    <dokka-maven-plugin.version>1.7.10</dokka-maven-plugin.version>
    <jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
    <java.require.version>11</java.require.version>
    <jdeps.multiRelease>11</jdeps.multiRelease>
    <junit.version>4.13.2</junit.version>
    <kotlin.version>1.7.20</kotlin.version>
    <maven-dependency-plugin.version>3.3.0</maven-dependency-plugin.version>
    <maven-plugin-tools.version>3.6.4</maven-plugin-tools.version>
    <maven-resolver.version>1.8.2</maven-resolver.version>
    <maven.compiler.release>8</maven.compiler.release>
    <maven.version>3.5.4</maven.version>
    <plexus-containers.version>2.1.1</plexus-containers.version>
    <sisu.version>0.3.5</sisu.version>
    <slf4j.version>1.7.36</slf4j.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>31.1-jre</version>
      </dependency>
      <dependency>
        <groupId>com.google.inject</groupId>
        <artifactId>guice</artifactId>
        <version>5.1.0</version>
      </dependency>
      <dependency>
        <groupId>com.thoughtworks.qdox</groupId>
        <artifactId>qdox</artifactId>
        <version>2.0.2</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.11.0</version>
      </dependency>
      <dependency>
        <groupId>javax.annotation</groupId>
        <artifactId>javax.annotation-api</artifactId>
        <version>1.3.2</version>
      </dependency>
      <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.12.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.4.15</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-artifact</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-compat</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-model</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-settings</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugin-testing</groupId>
        <artifactId>maven-plugin-testing-harness</artifactId>
        <version>3.3.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>${maven-plugin-tools.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-tools-annotations</artifactId>
        <version>${maven-plugin-tools.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-tools-api</artifactId>
        <version>${maven-plugin-tools.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.3.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.resolver</groupId>
        <artifactId>maven-resolver-api</artifactId>
        <version>${maven-resolver.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.resolver</groupId>
        <artifactId>maven-resolver-connector-basic</artifactId>
        <version>${maven-resolver.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.resolver</groupId>
        <artifactId>maven-resolver-impl</artifactId>
        <version>${maven-resolver.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.resolver</groupId>
        <artifactId>maven-resolver-spi</artifactId>
        <version>${maven-resolver.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.resolver</groupId>
        <artifactId>maven-resolver-transport-file</artifactId>
        <version>${maven-resolver.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.resolver</groupId>
        <artifactId>maven-resolver-transport-http</artifactId>
        <version>${maven-resolver.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.resolver</groupId>
        <artifactId>maven-resolver-util</artifactId>
        <version>${maven-resolver.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.shared</groupId>
        <artifactId>maven-shared-utils</artifactId>
        <version>3.3.4</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-provider-api</artifactId>
        <version>3.5.2</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-archiver</artifactId>
        <version>4.5.0</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-annotations</artifactId>
        <version>${plexus-containers.version}</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-interpolation</artifactId>
        <version>1.26</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-utils</artifactId>
        <version>3.4.2</version>
      </dependency>
      <dependency>
        <groupId>org.eclipse.sisu</groupId>
        <artifactId>org.eclipse.sisu.inject</artifactId>
        <version>${sisu.version}</version>
      </dependency>
      <dependency>
        <groupId>org.eclipse.sisu</groupId>
        <artifactId>org.eclipse.sisu.plexus</artifactId>
        <version>${sisu.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jetbrains</groupId>
        <artifactId>markdown-jvm</artifactId>
        <version>0.3.1</version>
      </dependency>
      <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-compiler-embeddable</artifactId>
        <version>${kotlin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-compiler-manager</artifactId>
        <version>2.12.1</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>animal-sniffer-maven-plugin</artifactId>
          <version>1.22</version>
        </plugin>
        <plugin>
          <groupId>org.eclipse.sisu</groupId>
          <artifactId>sisu-maven-plugin</artifactId>
          <version>${sisu.version}</version>
        </plugin>
        <plugin>
          <groupId>org.jetbrains.dokka</groupId>
          <artifactId>dokka-maven-plugin</artifactId>
          <version>${dokka-maven-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <inherited>false</inherited>
        <configuration>
          <!-- Since we flatten the POMs we don't need to deploy the parent -->
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.5.0,3.9)</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>[11,12)</version>
                </requireJavaVersion>
                <!-- When there are multiple versions of a dependency you have to choose which one to use. -->
                <dependencyConvergence/>
                <requireReleaseDeps>
                  <message>No Snapshots Allowed!</message>
                  <onlyWhenRelease>true</onlyWhenRelease>
                </requireReleaseDeps>
                <!-- When there are multiple versions of a dependency you have to choose the maximum version. -->
                <requireUpperBoundDeps/>
                <requirePluginVersions>
                  <message>Best Practice is to always define plugin versions!</message>
                  <banLatest>true</banLatest>
                  <banRelease>true</banRelease>
                  <banSnapshots>true</banSnapshots>
                  <phases>clean,deploy,site</phases>
                  <additionalPlugins>
                    <additionalPlugin>org.apache.maven.plugins:maven-javadoc-plugin</additionalPlugin>
                    <additionalPlugin>org.apache.maven.plugins:maven-release-plugin</additionalPlugin>
                    <additionalPlugin>org.apache.maven.plugins:maven-source-plugin</additionalPlugin>
                  </additionalPlugins>
                </requirePluginVersions>
                <bannedPlugins>
                  <excludes>
                    <exclude>org.apache.maven.plugins:maven-verifier-plugin</exclude>
                  </excludes>
                  <message>Please consider using the maven-invoker-plugin (http://maven.apache.org/plugins/maven-invoker-plugin/)!</message>
                </bannedPlugins>
                <requireNoRepositories>
                  <message>Best Practice is to never define repositories in pom.xml (use a repository manager instead)</message>
                </requireNoRepositories>
                <banDuplicateClasses>
                  <findAllDuplicates>true</findAllDuplicates>
                </banDuplicateClasses>
                <enforceBytecodeVersion>
                  <maxJdkVersion>8</maxJdkVersion>
                </enforceBytecodeVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <configuration>
          <signature>
            <groupId>org.codehaus.mojo.signature</groupId>
            <artifactId>java18</artifactId>
            <version>1.0</version>
          </signature>
        </configuration>
        <executions>
          <execution>
            <id>verify-java8</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>test</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-test-source</id>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <phase>generate-test-sources</phase>
            <configuration>
              <sources>
                <source>src/test/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <projectName>kotlin-maven-plugin-tools</projectName>
          <licenseName>apache_v2</licenseName>
        </configuration>
        <executions>
          <execution>
            <id>config</id>
            <goals>
              <goal>update-file-header</goal>
            </goals>
            <phase>process-sources</phase>
            <configuration>
              <roots>${basedir}</roots>
              <includes>.editorconfig,.gitattributes,pom.xml</includes>
              <extraExtensions>
                <editorconfig>properties</editorconfig>
                <gitattributes>properties</gitattributes>
                <yml>properties</yml>
              </extraExtensions>
            </configuration>
          </execution>
          <execution>
            <id>sources</id>
            <goals>
              <goal>update-file-header</goal>
            </goals>
            <phase>process-sources</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <configuration>
          <excludes>
            <!-- Exclude data classes -->
            <exclude>com/github/gantsign/maven/tools/plugin/extractor/kotlin/internal/model/**</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <phase>process-sources</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <url>https://github.com/gantsign/kotlin-maven-plugin-tools</url>

  <inceptionYear>2018</inceptionYear>

  <organization>
    <name>GantSign Ltd.</name>
  </organization>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://opensource.org/licenses/Apache-2.0</url>
      <distribution>repo</distribution>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>John Freeman</name>
      <url>https://github.com/freemanjp</url>
      <organization>GantSign Ltd.</organization>
      <roles>
        <role>architect</role>
        <role>developer</role>
      </roles>
      <timezone>Europe/London</timezone>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/gantsign/kotlin-maven-plugin-tools.git</connection>
    <developerConnection>scm:git:git@github.com:gantsign/kotlin-maven-plugin-tools.git</developerConnection>
    <url>https://github.com/gantsign/kotlin-maven-plugin-tools</url>
    <tag>HEAD</tag>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/gantsign/kotlin-maven-plugin-tools/issues</url>
  </issueManagement>

  <ciManagement>
    <system>GitHub Actions</system>
    <url>https://github.com/gantsign/kotlin-maven-plugin-tools/actions</url>
  </ciManagement>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <profiles>
    <profile>
      <id>github</id>

      <activation>
        <property>
          <name>env.GITHUB_ACTIONS</name>
        </property>
      </activation>

      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-gpg-plugin</artifactId>
              <configuration>
                <gpgArguments>
                  <arg>--pinentry-mode</arg>
                  <arg>loopback</arg>
                </gpgArguments>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <profile>
      <id>publish-artifacts</id>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.jetbrains.dokka</groupId>
            <artifactId>dokka-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>javadocJar</goal>
                </goals>
                <phase>package</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>

</project>
