<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>dev.snowdrop</groupId>
  <artifactId>buildpack-client-project</artifactId>
  <version>0.0.12</version>
  <packaging>pom</packaging>
  <name>Snowdrop :: Java Buildpack Client :: Project</name>
  <description>A Buildpack client implementation written in Java</description>

  <url>http://github.com/snowdrop/java-buildpack-client</url>
  <inceptionYear>2020</inceptionYear>

  <organization>
    <name>Red Hat</name>
    <url>http://redhat.com</url>
  </organization>

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

  <!-- including A developer as it's required by the maven poms going into central -->
  <developers>
    <developer>
      <id>geeks</id>
      <name>Snowdrop Development Team</name>
      <organization>snowdrop</organization>
      <organizationUrl>http://snowdrop.dev/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/snowdrop/java-buildpack-client.git</connection>
    <developerConnection>scm:git:ssh://git@github.com:snowdrop/java-buildpack-client.git</developerConnection>
    <url>http://github.com/snowdrop/java-buildpack-client</url>
    <tag>0.0.12</tag>
  </scm>

  <distributionManagement>
    <repository>
      <id>oss-sonatype-staging</id>
      <name>Sonatype Staging Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
    </repository>
    <snapshotRepository>
      <id>oss-sonatype-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>	  
  </distributionManagement>

  <properties>
    <java.source>1.8</java.source>
    <java.target>1.8</java.target>
    <!-- Dependency Versions -->
    <version.docker-java>3.3.4</version.docker-java>
    <version.slf4j>1.7.30</version.slf4j>
    <version.commons-compress>1.20</version.commons-compress>
    <version.jackson>2.12.3</version.jackson>
    <version.sundrio>0.80.0</version.sundrio>
    <version.lombok>1.18.22</version.lombok>
    <version.findbugs>3.0.1u2</version.findbugs>
    <version.junit>5.4.0</version.junit>
    <version.mockito>3.12.4</version.mockito>

    <!-- Maven Plugin Versions -->
    <version.maven-compiler-plugin>3.13.0</version.maven-compiler-plugin>
    <version.maven-surefire-plugin>3.3.0</version.maven-surefire-plugin>
    <version.maven-failsafe-plugin>3.3.0</version.maven-failsafe-plugin>

    <!-- Release Plugins -->
    <version.maven-release-plugin>3.1.0</version.maven-release-plugin>
    <version.maven-gpg-plugin>3.2.4</version.maven-gpg-plugin>
    <version.maven-enforcer-plugin>1.3.1</version.maven-enforcer-plugin>
    <version.maven-javadoc-plugin>3.7.0</version.maven-javadoc-plugin>
    <version.maven-source-plugin>3.3.1</version.maven-source-plugin>
    <version.nexus-staging-maven-plugin>1.6.13</version.nexus-staging-maven-plugin>	  
  </properties>

  <modules>
    <module>client</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.github.docker-java</groupId>
        <artifactId>docker-java-api</artifactId>
        <version>${version.docker-java}</version>
      </dependency>
      <dependency>
        <groupId>com.github.docker-java</groupId>
        <artifactId>docker-java-core</artifactId>
        <version>${version.docker-java}</version>
      </dependency>
      <dependency>
        <groupId>com.github.docker-java</groupId>
        <artifactId>docker-java-transport-httpclient5</artifactId>
        <version>${version.docker-java}</version>
        <exclusions>
          <exclusion>
            <groupId>org.checkerframework</groupId>
            <artifactId>*</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.tomlj</groupId>
        <artifactId>tomlj</artifactId>
        <version>1.1.1</version>
      </dependency>      
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-compress</artifactId>
        <version>${version.commons-compress}</version>
      </dependency>
      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>${version.lombok}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>io.sundr</groupId>
        <artifactId>builder-annotations</artifactId>
        <version>${version.sundrio}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>${version.jackson}</version>
      </dependency>
      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>annotations</artifactId>
        <version>${version.findbugs}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${version.junit}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-inline</artifactId>
        <version>${version.mockito}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-junit-jupiter</artifactId>
        <version>${version.mockito}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.maven-compiler-plugin}</version>
        <configuration>
          <source>${java.source}</source>
          <target>${java.target}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${version.maven-surefire-plugin}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${version.maven-failsafe-plugin}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
	      <version>${version.maven-source-plugin}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <properties>
        <skipITs>true</skipITs>
        <format.skip>true</format.skip>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${version.maven-gpg-plugin}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <!-- This is necessary for gpg to not try to use the pinentry programs -->
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>${version.maven-enforcer-plugin}</version>
            <executions>
              <execution>
                <id>enforce-no-snapshots</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireReleaseDeps>
                      <message>No Snapshots Allowed!</message>
                    </requireReleaseDeps>
                  </rules>
                  <fail>false</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${version.maven-javadoc-plugin}</version>
            <configuration>
              <includeDependencySources>${javadoc.include.deps}</includeDependencySources>
              <dependencySourceIncludes>
                <dependencySourceInclude>${javadoc.source.includes}</dependencySourceInclude>
              </dependencySourceIncludes>
              <excludePackageNames>${javadoc.package.excludes}</excludePackageNames>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <additionalparam>${javadoc.opts}</additionalparam>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${version.maven-source-plugin}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-release-plugin</artifactId>
             <version>${version.maven-release-plugin}</version>
             <configuration>
               <autoVersionSubmodules>true</autoVersionSubmodules>
               <tagNameFormat>@{project.version}</tagNameFormat>
               <pushChanges>false</pushChanges>
               <localCheckout>true</localCheckout>
               <remoteTagging>false</remoteTagging>
               <arguments>-DskipTests=true</arguments>
             </configuration>
           </plugin>
           <plugin>
             <groupId>org.sonatype.plugins</groupId>
             <artifactId>nexus-staging-maven-plugin</artifactId>
             <version>${version.nexus-staging-maven-plugin}</version>
             <extensions>true</extensions>
             <configuration>
               <serverId>oss-sonatype-staging</serverId>
               <nexusUrl>https://oss.sonatype.org/</nexusUrl>
               <autoReleaseAfterClose>true</autoReleaseAfterClose>
               <stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>
             </configuration>
           </plugin>		
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
