<?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.planlibre</groupId>
  <artifactId>helikopterparent</artifactId>
  <version>1.2.0</version>
  <packaging>pom</packaging>

  <name>Helikopter Parent</name>
  <description>
    A demo for build, deployment to the Central Repository via OSSRH
    and some convenience mvn cruft when used as a parent pom.
  </description>
  <url>https://github.com/nelbrecht/helikopterparent</url>
  <licenses>
    <license>
      <name>BSD 3-Clause License</name>
      <url>https://raw.githubusercontent.com/nelbrecht/helikopterparent/master/LICENSE</url>
      <distribution>repo</distribution>
      <comments>License is as offerd by github</comments>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Norbert Elbrecht</name>
      <email>4git.20.elbrecht@planlibre.de</email>
      <organization>Plan Libre software architecture movement</organization>
      <organizationUrl>https://www.planlibre.de/</organizationUrl>
    </developer>
  </developers>
  <scm>
      <connection>scm:git:ssh://git@github.com:nelbrecht/helikopterparent.git</connection>
      <developerConnection>scm:git:ssh://git@github.com:nelbrecht/helikopterparent.git</developerConnection>
      <url>https://github.com/nelbrecht/helikopterparent</url>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <name>Central Repository OSSRH</name>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <name>Central Repository OSSRH</name>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>
    <maven.minimum.version>3.6.3</maven.minimum.version>
    <skip-maven-gpg-plugin>false</skip-maven-gpg-plugin>

    <junit.jupiter.version>5.8.2</junit.jupiter.version>

    <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
    <maven-dependency-plugin.version>3.2.0</maven-dependency-plugin.version>
    <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
    <maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version>
    <maven-git-commit-id-plugin.version>4.9.10</maven-git-commit-id-plugin.version>
    <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
    <maven-help-plugin.version>3.2.0</maven-help-plugin.version>
    <maven-install-plugin.version>2.5.2</maven-install-plugin.version>
    <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version>
    <maven-site-plugin.version>3.9.1</maven-site-plugin.version>
    <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
    <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
    <versions-maven-plugin.version>2.8.1</versions-maven-plugin.version>

    <!-- site -->
    <site.url>file:///${basedir}/target/sitedeployment</site.url>
    <siteUrl>${site.url}</siteUrl><!-- workaround for the fact that Velocity Templates cannot reference properties with dots in their name -->

    <commons-collections.version>3.2.2</commons-collections.version> <!-- patched v3 for plugins -->
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit.jupiter.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
    </dependencies>
  </dependencyManagement>

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

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>pl.project13.maven</groupId>
          <artifactId>git-commit-id-plugin</artifactId>
          <version>${maven-git-commit-id-plugin.version}</version>
          <executions>
            <execution>
              <id>get-the-git-infos</id>
              <goals>
                <goal>revision</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <verbose>false</verbose>
            <dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
            <generateGitPropertiesFile>true</generateGitPropertiesFile>
            <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
          <configuration>
            <showDeprecation>true</showDeprecation>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-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-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-site-plugin</artifactId>
          <version>${maven-site-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>commons-collections</groupId>
              <artifactId>commons-collections</artifactId>
              <version>${commons-collections.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>${versions-maven-plugin.version}</version>
        </plugin>
        <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>
                <fail>false</fail>
                <rules>
                  <banDuplicatePomDependencyVersions/>
                  <dependencyConvergence/>
                  <requireMavenVersion>
                    <version>${maven.minimum.version}</version>
                  </requireMavenVersion>
                  <requireJavaVersion>
                    <version>${maven.compiler.release}</version>
                  </requireJavaVersion>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-help-plugin</artifactId>
          <version>${maven-help-plugin.version}</version>
          <executions>
            <execution>
              <id>effective-pom</id>
              <configuration>
                <output>${project.build.directory}/effective.pom.xml</output>
                <verbose>true</verbose>
              </configuration>
              <phase>validate</phase>
              <goals>
                <goal>effective-pom</goal>
              </goals>
            </execution>
            <execution>
              <id>active-profiles</id>
              <phase>validate</phase>
              <goals>
                <goal>active-profiles</goal>
              </goals>
            </execution>
          </executions>
          <inherited>true</inherited>
          <dependencies>
            <dependency>
              <groupId>commons-collections</groupId>
              <artifactId>commons-collections</artifactId>
              <version>${commons-collections.version}</version>
            </dependency>
          </dependencies>
        </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-no-fork</goal>
              </goals>
            </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>
            </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>verify</phase>
              <goals>
                <goal>sign</goal>
              </goals>
              <configuration>
                <skip>${skip-maven-gpg-plugin}</skip>
                <keyname>B8350ABFE13AB1A016774AC5F7FA65D6633DD3EA</keyname>
                <passphrase>${env.MAVEN_GPG_PASSPHRASE}</passphrase>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-help-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-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>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>manage-updates</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <configuration combine.children="append">
              <rulesUri>file://${user.home}/.m2/version-rules.xml</rulesUri>
            </configuration>
            <executions>
              <execution>
                <id>display-dependency-updates</id>
                <phase>validate</phase>
                <goals>
                  <goal>display-dependency-updates</goal>
                </goals>
              </execution>
              <execution>
                <id>display-property-updates</id>
                <phase>validate</phase>
                <goals>
                  <goal>display-property-updates</goal>
                </goals>
              </execution>
              <execution>
                <id>display-plugin-updates</id>
                <phase>validate</phase>
                <goals>
                  <goal>display-plugin-updates</goal>
                </goals>
              </execution>
            </executions>
            <inherited>true</inherited>
            <dependencies>
              <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>${commons-collections.version}</version>
              </dependency>
            </dependencies>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>${maven-dependency-plugin.version}</version>
            <executions>
              <execution>
                <id>dependency-tree-compile</id>
                <configuration>
                  <appendOutput>true</appendOutput>
                  <outputFile>${project.build.directory}/dependency-tree</outputFile>
                </configuration>
                <phase>validate</phase>
                <goals>
                  <goal>tree</goal>
                </goals>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>${commons-collections.version}</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <site>
          <id>filelocal</id>
          <url>${site.url}</url>
        </site>
      </distributionManagement>
    </profile>
  </profiles>
</project>
