<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2015 Red Hat, Inc.

    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.

-->
<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>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>9</version>
  </parent>

  <groupId>io.fabric8</groupId>
  <artifactId>kubernetes-client-project</artifactId>
  <version>4.4.2</version>
  <packaging>pom</packaging>
  <name>Fabric8 :: Kubernetes :: Project</name>

  <url>http://fabric8.io/</url>
  <inceptionYear>2015</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>Fabric8 Development Team</name>
      <organization>fabric8</organization>
      <organizationUrl>http://fabric8.io/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:fabric8io/kubernetes-client.git</connection>
    <developerConnection>scm:git:git@github.com:fabric8io/kubernetes-client.git</developerConnection>
    <url>http://github.com/fabric8io/kubernetes-client/</url>
    <tag>${project.version}</tag>
  </scm>

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

  <properties>
    <useIncrementalCompilation>false</useIncrementalCompilation>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!-- Core versions -->
    <sundrio.version>0.17.2</sundrio.version>
    <okhttp.version>3.12.0</okhttp.version>
    <okhttp.bundle.version>3.12.0_1</okhttp.bundle.version>
    <okio.version>1.15.0</okio.version>
    <okio.bundle.version>1.15.0_1</okio.bundle.version>
    <jackson.version>2.9.9</jackson.version>
    <jackson.version.databind>2.9.9.3</jackson.version.databind>
    <mockwebserver.version>0.1.2</mockwebserver.version>

    <!-- API versions -->
    <jsr305.version>3.0.2</jsr305.version>
    <validation.api.version>2.0.1.Final</validation.api.version>

    <!-- Testing versions -->
    <assertj.core.version>3.13.2</assertj.core.version>
    <arquillian.core.version>1.2.0.Final</arquillian.core.version>
    <awaitility.version>3.1.6</awaitility.version>
    <jsonassert.version>1.5.0</jsonassert.version>

    <retrofit.bundle.version>2.5.0_1</retrofit.bundle.version>
    <conscrypt-openjdk-uber.version>1.4.2</conscrypt-openjdk-uber.version>
    <conscrypt-openjdk-uber.bundle.version>1.4.2_1</conscrypt-openjdk-uber.bundle.version>
    <generex.version>1.0.2</generex.version>
    <generex.bundle.version>1.0.1_1</generex.bundle.version>
    <automaton.version>1.11-8</automaton.version>
    <automaton.bundle.version>1.11-8_1</automaton.bundle.version>
    <jackson.bundle.version>${jackson.version}</jackson.bundle.version>
    <junit.version>5.5.1</junit.version>
    <log4j.version>2.12.0</log4j.version>
    <zjsonpatch.version>0.3.0</zjsonpatch.version>
    <arquillian.cube.version>1.18.2</arquillian.cube.version>
    <slf4j.version>1.7.26</slf4j.version>
    <lombok.version>1.18.8</lombok.version>
    <snakeyaml.version>1.24</snakeyaml.version>
    <bouncycastle.version>1.62</bouncycastle.version>
    <commons-codec.version>1.13</commons-codec.version>
    <commons-compress.version>1.18</commons-compress.version>
    <scr.annotations.version>1.12.0</scr.annotations.version>
    <jsonschema2pojo.version>0.4.23</jsonschema2pojo.version>

    <!-- Maven plugin versions -->
    <buildnumber.plugin.version>1.4</buildnumber.plugin.version>
    <maven.bundle.plugin.version>4.2.0</maven.bundle.plugin.version>
    <maven.buildhelper.plugin.version>3.0.0</maven.buildhelper.plugin.version>
    <maven.jar.plugin.version>3.1.2</maven.jar.plugin.version>
    <maven.resources.plugin.version>3.0.1</maven.resources.plugin.version>
    <maven.surefire.plugin.version>3.0.0-M3</maven.surefire.plugin.version>
    <maven.scr.plugin.version>1.26.2</maven.scr.plugin.version>
    <maven.bundle.plugin.version>4.1.0</maven.bundle.plugin.version>
    <maven.buildhelper.plugin.version>3.0.0</maven.buildhelper.plugin.version>
    <maven.jar.plugin.version>3.1.1</maven.jar.plugin.version>
    <maven.resources.plugin.version>3.1.0</maven.resources.plugin.version>
    <maven.surefire.plugin.version>3.0.0-M3</maven.surefire.plugin.version>
    <maven.scr.plugin.version>1.26.0</maven.scr.plugin.version>
    <jandex.plugin.version>1.0.6</jandex.plugin.version>

    <!-- Other options -->
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <svc.version>1.1.1</svc.version>

    <exec.master>https://localhost:8443</exec.master>

    <javadoc.include.deps>false</javadoc.include.deps>
    <javadoc.source.includes />
    <javadoc.package.excludes />

    <osgi.import />
    <osgi.export />
    <osgi.private />
    <osgi.dynamic.import />
    <osgi.bundles />
    <osgi.activator />
    <osgi.export.service />
    <osgi.include.resources>{maven-resources}</osgi.include.resources>
    <karaf.itest.skip>false</karaf.itest.skip>
  </properties>

  <modules>
    <module>kubernetes-model</module>
    <module>kubernetes-client</module>
    <module>kubernetes-server-mock</module>
    <module>openshift-client</module>
    <module>extensions</module>
    <module>openshift-server-mock</module>
    <module>kubernetes-examples</module>
    <module>platforms</module>
    <module>kubernetes-tests</module>
    <module>uberjar</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <!-- Internal -->
       <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-model</artifactId>
        <version>${project.version}</version>
       </dependency>
       <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-client</artifactId>
        <version>${project.version}</version>
       </dependency>
       <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>openshift-client</artifactId>
        <version>${project.version}</version>
       </dependency>
       <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-server-mock</artifactId>
        <version>${project.version}</version>
       </dependency>
       <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>knative-model</artifactId>
        <version>${project.version}</version>
       </dependency>
       <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>knative-client</artifactId>
        <version>${project.version}</version>
       </dependency>
       <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>knative-server-mock</artifactId>
        <version>${project.version}</version>
       </dependency>
       <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>tekton-model</artifactId>
        <version>${project.version}</version>
       </dependency>
       <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>tekton-client</artifactId>
        <version>${project.version}</version>
       </dependency>
       <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>tekton-server-mock</artifactId>
        <version>${project.version}</version>
       </dependency>


       <!-- Dependencies -->
       <dependency>
        <groupId>com.fasterxml.jackson.module</groupId>
        <artifactId>jackson-module-jaxb-annotations</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>${validation.api.version}</version>
      </dependency>
      <dependency>
        <groupId>io.sundr</groupId>
        <artifactId>builder-annotations</artifactId>
        <version>${sundrio.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>io.sundr</groupId>
        <artifactId>transform-annotations</artifactId>
        <version>${sundrio.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>${lombok.version}</version>
      </dependency>

      <!-- Testing and Mocking -->
      <dependency>
        <groupId>io.dekorate</groupId>
        <artifactId>mockwebserver</artifactId>
        <version>${mockwebserver.version}</version>
      </dependency>

      <dependency>
        <groupId>org.skyscreamer</groupId>
        <artifactId>jsonassert</artifactId>
        <version>${jsonassert.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-migrationsupport</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <!-- Create jandex index for faster performance in environments that use it -->
      <plugin>
        <groupId>org.jboss.jandex</groupId>
        <artifactId>jandex-maven-plugin</artifactId>
        <version>${jandex.plugin.version}</version>
        <executions>
          <execution>
            <id>make-index</id>
            <goals>
              <goal>jandex</goal>
            </goals>
            <inherited>true</inherited>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.jboss</groupId>
            <artifactId>jandex</artifactId>
            <version>2.1.1.Final</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.4</version>
        <executions>
          <execution>
            <id>default-prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>default-report</id>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <inherited>true</inherited>
        <version>${maven.surefire.plugin.version}</version>
        <configuration>
          <environmentVariables>
            <ENV_VAR_EXISTS>value</ENV_VAR_EXISTS>
            <ENV_VAR_EXISTS_BOOLEAN>true</ENV_VAR_EXISTS_BOOLEAN>
          </environmentVariables>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>3.0</version>
        <configuration>
          <aggregate>true</aggregate>
          <header>header.txt</header>
          <properties>
            <owner>Red Hat, Inc.</owner>
          </properties>
          <excludes>
            <exclude>.editorconfig</exclude>
            <exclude>license.txt</exclude>
            <exclude>**/test-kubeconfig</exclude>
            <exclude>kubernetes-model/vendor/**/*</exclude>
            <exclude>kubernetes-model/generate</exclude>
            <exclude>kubernetes-model/.openshift-version</exclude>
            <exclude>kubernetes-model/glide.*</exclude>
            <exclude>kubernetes-model/Gopkg.*</exclude>
            <exclude>kubernetes-client/src/test/resources/*</exclude>
            <exclude>Jenkinsfile</exclude>
          </excludes>
          <mapping>
            <go>JAVADOC_STYLE</go>
            <svg>XML_STYLE</svg>
            <Makefile>SCRIPT_STYLE</Makefile>
          </mapping>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>${maven.bundle.plugin.version}</version>
        <extensions>true</extensions>
        <inherited>true</inherited>
        <configuration>
          <instructions>
            <Bundle-Name>${project.name}</Bundle-Name>
            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
            <Export-Package>${osgi.export}</Export-Package>
            <Import-Package>${osgi.import}</Import-Package>
            <DynamicImport-Package>${osgi.dynamic.import}</DynamicImport-Package>
            <Private-Package>${osgi.private}</Private-Package>
            <Require-Bundle>${osgi.bundles}</Require-Bundle>
            <Bundle-Activator>${osgi.activator}</Bundle-Activator>
            <Export-Service>${osgi.export.service}</Export-Service>
            <Include-Resource>${osgi.include.resources}</Include-Resource>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>io.sundr</groupId>
        <artifactId>sundr-maven-plugin</artifactId>
        <version>${sundrio.version}</version>
        <dependencies>
          <dependency>
            <groupId>io.sundr</groupId>
            <artifactId>sundr-codegen</artifactId>
            <version>${sundrio.version}</version>
            <exclusions>
              <exclusion>
                <groupId>com.sun</groupId>
                <artifactId>tools</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
        </dependencies>
        <configuration>
          <boms>
            <bom>
              <artifactId>kubernetes-client-bom</artifactId>
              <name>Fabric8 :: Kubernetes :: Bom</name>
              <properties>
                <skipStagingRepositoryClose>true</skipStagingRepositoryClose>
              </properties>
            </bom>
            <bom>
              <artifactId>kubernetes-client-bom-with-deps</artifactId>
              <name>Fabric8 :: Kubernetes :: Bom with Dependencies</name>
              <dependencies>
                <includes>
                  <include>com.squareup*:*</include>
                  <include>com.fasterxml.jackson*:*</include>
                  <include>io.fabric8:kubernetes-model*</include>
                </includes>
              </dependencies>
              <properties>
                <skipStagingRepositoryClose>true</skipStagingRepositoryClose>
              </properties>
            </bom>
          </boms>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>generate-bom</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>${maven.buildhelper.plugin.version}</version>
        <inherited>true</inherited>
        <executions>
          <execution>
            <id>parse-version</id>
            <goals>
              <goal>parse-version</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.8</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>oss-sonatype-staging</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <properties>
        <karaf.itest.skip>true</karaf.itest.skip>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <configuration>
              <passphrase>4uds0n</passphrase>
              <useAgent>true</useAgent>
            </configuration>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
              <autoVersionSubmodules>true</autoVersionSubmodules>
              <pushChanges>false</pushChanges>
              <localCheckout>true</localCheckout>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>1.4.1</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>3.1.1</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>3.0.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>itests-kubernetes</id>
      <modules>
        <module>kubernetes-itests</module>
      </modules>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven.surefire.plugin.version}</version>
            <configuration>
              <skipTests>true</skipTests>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${maven.surefire.plugin.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>org.arquillian.cube</groupId>
          <artifactId>arquillian-cube-kubernetes-starter</artifactId>
          <version>${arquillian.cube.version}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>itests-openshift</id>
      <modules>
        <module>kubernetes-itests</module>
      </modules>
      <dependencies>
        <dependency>
          <groupId>org.arquillian.cube</groupId>
          <artifactId>arquillian-cube-openshift-starter</artifactId>
          <version>${arquillian.cube.version}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven.surefire.plugin.version}</version>
            <configuration>
              <skipTests>true</skipTests>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${maven.surefire.plugin.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>doclint-java8-disable</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <properties>
        <javadoc.opts>-Xdoclint:none</javadoc.opts>
      </properties>
    </profile>
  </profiles>
</project>
