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

    Copyright (C) 2018 Alauda, 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.alauda</groupId>
  <artifactId>kubernetes-client-project</artifactId>
  <version>0.2.7</version>
  <packaging>pom</packaging>
  <name>Alauda :: Kubernetes :: Project</name>

  <url>http://alauda.io/</url>
  <inceptionYear>2018</inceptionYear>

  <organization>
    <name>Alauda</name>
    <url>http://alauda.io</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>alaudaDevelopers</id>
      <name>Alauda Developers</name>
      <organization>alauda</organization>
      <organizationUrl>http://alauda.io/</organizationUrl>
      <email>devs@alauda.io</email>
    </developer>
  </developers>

  <scm>
    <tag>${project.version}</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>
      <name>OSS Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <repositories>
    <repository>
      <id>sonatype</id>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
      </snapshots>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
  </repositories>

  <properties>
    <kubernetes.model.version>0.2.8</kubernetes.model.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <mockwebserver.version>0.1.0</mockwebserver.version>
    <okhttp.version>3.9.1</okhttp.version>
    <okhttp.bundle.version>3.9.1_2</okhttp.bundle.version>
    <okio.version>1.13.0</okio.version>
    <okio.bundle.version>1.13.0_1</okio.bundle.version>
    <generex.version>1.0.1</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.version>2.7.7</jackson.version>
    <jackson.bundle.version>${jackson.version}</jackson.bundle.version>
    <junit.version>4.12</junit.version>
    <log4j.version>2.5</log4j.version>
    <zjsonpatch.version>0.3.0</zjsonpatch.version>
    <arquillian.cube.version>1.15.2</arquillian.cube.version>
    <assertj.core.version>3.8.0</assertj.core.version>
    <arquillian.core.version>1.2.0.Final</arquillian.core.version>

    <slf4j.version>1.7.13</slf4j.version>
    <snakeyaml.version>1.20</snakeyaml.version>

    <scr.annotations.version>1.9.12</scr.annotations.version>
    <sundrio.version>0.3.12</sundrio.version>
    <validation.api.version>1.1.0.Final</validation.api.version>

    <maven.bundle.plugin.version>2.5.4</maven.bundle.plugin.version>
    <maven.buildhelper.plugin.version>1.10</maven.buildhelper.plugin.version>
    <maven.jar.plugin.version>3.0.1</maven.jar.plugin.version>
    <maven.resources.plugin.version>3.0.1</maven.resources.plugin.version>
    <maven.surefire.plugin.version>2.19.1</maven.surefire.plugin.version>
    <maven.scr.plugin.version>1.22.0</maven.scr.plugin.version>

    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>

    <lombok.version>1.16.10</lombok.version>

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

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

  <modules>
    <module>devops-client</module>
    <!--<module>devops-server-mock</module>-->
    <module>kubernetes-client</module>
    <!--<module>kubernetes-server-mock</module>-->
    <!--<module>kubernetes-examples</module>-->
    <!--<module>kubernetes-tests</module>-->
    <!--<module>kubernetes-itests</module>-->
  </modules>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <inherited>true</inherited>
        <version>2.18.1</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>2.11</version>
        <configuration>
          <aggregate>true</aggregate>
          <header>header.txt</header>
          <properties>
            <owner>Alauda, Inc.</owner>
          </properties>
          <excludes>
            <exclude>.editorconfig</exclude>
            <exclude>license.txt</exclude>
            <exclude>**/test-kubeconfig</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                    <arg>--no-tty</arg>
                  </gpgArguments>
                  <interactive>false</interactive>
                  <passphrase>18211191651</passphrase>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>1.3.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>true</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.3</version>
            <configuration>
              <additionalparam>${javadoc.opts}</additionalparam>
              <encoding>UTF-8</encoding>
              <docencoding>UTF-8</docencoding>
              <linksource>false</linksource>
              <maxmemory>512m</maxmemory>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.4</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>staging</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>oss-sonatype-snapshots</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </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>
