<?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>org.bremersee</groupId>
  <artifactId>common-parent</artifactId>
  <version>1.0.0</version>
  <packaging>pom</packaging>

  <name>common-parent</name>
  <description>Bremersee's common parent</description>
  <url>https://github.com/bremersee/common-parent</url>

  <properties>
    <github.global.server>github</github.global.server>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <product.vendor>bremersee.org</product.vendor>
    <inceptionYear>2019</inceptionYear>

    <spring-boot.version>2.1.6.RELEASE</spring-boot.version>
    <spring-cloud.version>Greenwich.SR1</spring-cloud.version>

    <swagger-annotations.version>1.5.22</swagger-annotations.version>

    <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
    <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
    <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
    <buildnumber-maven-plugin.version>1.4</buildnumber-maven-plugin.version>
    <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
    <maven-surefire-plugin.version>3.0.0-M3</maven-surefire-plugin.version>
    <maven-javadoc-plugin.version>3.1.0</maven-javadoc-plugin.version>
    <maven-site-plugin.version>3.7.1</maven-site-plugin.version>
    <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
    <plantuml.version>1.2018.11</plantuml.version>
    <wagon-webdav-jackrabbit.version>3.0.0</wagon-webdav-jackrabbit.version>
    <wagon-ssh-external.version>3.0.0</wagon-ssh-external.version>
    <maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
    <jacoco-maven-plugin>0.8.3</jacoco-maven-plugin>
    <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>

    <!-- reporting -->
    <maven-project-info-reports-plugin.version>3.0.0</maven-project-info-reports-plugin.version>
    <maven-surefire-report-plugin.version>3.0.0-M3</maven-surefire-report-plugin.version>
    <maven-jxr-plugin.version>3.0.0</maven-jxr-plugin.version>
    <jdepend-maven-plugin.version>2.0</jdepend-maven-plugin.version>
    <maven-pmd-plugin.version>3.11.0</maven-pmd-plugin.version>

    <check-style-location>google_checks.xml</check-style-location>
    <checkstyle.version>8.18</checkstyle.version>
  </properties>

  <developers>
    <developer>
      <id>bremersee</id>
      <name>Christian Bremer</name>
      <organization>bremersee.org</organization>
      <organizationUrl>http://bremersee.org</organizationUrl>
      <email>christian@bremersee.org</email>
      <timezone>+1</timezone>
      <roles>
        <role>Developer</role>
      </roles>
    </developer>
  </developers>

  <organization>
    <name>bremersee.org</name>
    <url>http://bremersee.org</url>
  </organization>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/bremersee/common-parent</url>
    <connection>scm:git:git://github.com/bremersee/common-parent.git</connection>
    <developerConnection>scm:git:git@github.com:bremersee/common-parent.git</developerConnection>
  </scm>

  <issueManagement>
    <url>https://github.com/bremersee/common-parent/issues</url>
    <system>GitHub Issues</system>
  </issueManagement>

  <distributionManagement>
    <!--
    <repository>
      <id>bremersee-releases</id>
      <url>https://nexus.bremersee.org/repository/maven-releases</url>
    </repository>
    -->
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <site>
      <id>bremersee-sites</id>
      <url>
        dav:https://nexus.bremersee.org/repository/maven-sites/common-parent/${project.version}
      </url>
    </site>
  </distributionManagement>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring-boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies</artifactId>
        <version>${spring-cloud.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>io.swagger</groupId>
        <artifactId>swagger-annotations</artifactId>
        <version>${swagger-annotations.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <optional>true</optional>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <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-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
          <configuration>
            <source>${java.version}</source>
            <target>${java.version}</target>
            <encoding>${project.build.sourceEncoding}</encoding>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven-jar-plugin.version}</version>
          <configuration>
            <archive>
              <addMavenDescriptor>true</addMavenDescriptor>
              <index>true</index>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              </manifest>
              <manifestEntries>
                <Product-Name>${project.artifactId}</Product-Name>
                <Product-Version>${project.version}</Product-Version>
                <Product-Vendor>${product.vendor}</Product-Vendor>
                <!--suppress MavenModelInspection -->
                <Implementation-Build>${buildNumber}</Implementation-Build>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>${buildnumber-maven-plugin.version}</version>
          <executions>
            <execution>
              <phase>validate</phase>
              <goals>
                <goal>create</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <doCheck>false</doCheck>
            <doUpdate>false</doUpdate>
            <shortRevisionLength>7</shortRevisionLength>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-plugin.version}</version>
          <configuration>
            <includes>
              <include>**/*Test.java</include>
              <include>**/*Tests.java</include>
            </includes>
            <excludes>
              <exclude>**/Abstract*.java</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
          <configuration>
            <show>protected</show>
            <quiet>true</quiet>
            <failOnError>false</failOnError>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>${maven-site-plugin.version}</version>
          <configuration>
            <generateReports>true</generateReports>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>net.sourceforge.plantuml</groupId>
              <artifactId>plantuml</artifactId>
              <version>${plantuml.version}</version>
            </dependency>
            <dependency>
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-ssh-external</artifactId>
              <version>${wagon-ssh-external.version}</version>
            </dependency>
            <dependency>
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-webdav-jackrabbit</artifactId>
              <version>${wagon-webdav-jackrabbit.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>${checkstyle.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco-maven-plugin}</version>
          <configuration>
            <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
            <dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
          </configuration>
          <executions>
            <execution>
              <id>jacoco-initialize</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
            <execution>
              <id>jacoco-site</id>
              <phase>package</phase>
              <goals>
                <goal>report</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven-deploy-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>${nexus-staging-maven-plugin.version}</version>
          <extensions>true</extensions>
          <configuration>
            <serverId>ossrh</serverId>
            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            <autoReleaseAfterClose>true</autoReleaseAfterClose>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-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>${maven-project-info-reports-plugin.version}</version>
        <configuration>
          <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <show>protected</show>
          <quiet>true</quiet>
          <failOnError>false</failOnError>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>${maven-surefire-report-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>${maven-jxr-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jdepend-maven-plugin</artifactId>
        <version>${jdepend-maven-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>${maven-pmd-plugin.version}</version>
        <configuration>
          <format>xml</format>
          <sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
          <minimumTokens>100</minimumTokens>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <configuration>
          <dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
        </configuration>
        <reportSets>
          <reportSet>
            <reports>
              <report>report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <configLocation>${check-style-location}</configLocation>
          <encoding>UTF-8</encoding>
          <inputEncoding>UTF-8</inputEncoding>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <consoleOutput>true</consoleOutput>
          <failOnViolation>false</failOnViolation>
          <failsOnError>true</failsOnError>
          <enableRulesSummary>true</enableRulesSummary>
          <enableFilesSummary>true</enableFilesSummary>
          <enableSeveritySummary>true</enableSeveritySummary>
          <lineLength>100</lineLength>
          <outputFileFormat>xml</outputFileFormat>
        </configuration>
        <reportSets>
          <reportSet>
            <reports>
              <report>checkstyle</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>deploy</id>
      <build>
        <plugins>
          <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>
                  <keyname>${gpg.keyname}</keyname>
                  <passphrase>${gpg.passphrase}</passphrase>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>