<!--
  ~ Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
  ~
  ~ 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.
  --><!--
  - 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>

  <groupId>com.hazelcast</groupId>
  <artifactId>hazelcast-kubernetes</artifactId>
  <version>2.0.1</version>
  <name>Kubernetes Discovery Plugin for Hazelcast</name>
  <description>Kubernetes Service Discovery for Hazelcast Discovery SPI</description>
  <url>http://github.com/hazelcast/hazelcast-kubernetes</url>
  <inceptionYear>2015</inceptionYear>
  <packaging>bundle</packaging>

  <properties>
    <!-- needed for checkstyle/findbugs -->
    <main.basedir>${project.basedir}</main.basedir>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <timestamp>${maven.build.timestamp}</timestamp>
    <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>

    <log4j.version>1.2.12</log4j.version>
    <junit.version>4.12</junit.version>
    <wiremock.version>2.25.1</wiremock.version>
    <hamcrest.version>1.3</hamcrest.version>
    <mockito.version>2.28.2</mockito.version>
    <powermock.version>2.0.2</powermock.version>

    <hazelcast.version>4.0-SNAPSHOT</hazelcast.version>

    <maven.checkstyle.plugin.version>2.15</maven.checkstyle.plugin.version>
    <maven.findbugs.plugin.version>3.0.4</maven.findbugs.plugin.version>
    <maven.surefire.plugin.version>2.18.1</maven.surefire.plugin.version>
    <maven.sonar.plugin.version>3.3.0.603</maven.sonar.plugin.version>
    <maven.jacoco.plugin.version>0.7.9</maven.jacoco.plugin.version>
    <maven.javadoc.plugin.version>2.9</maven.javadoc.plugin.version>
    <maven.gpg.plugin.version>1.4</maven.gpg.plugin.version>
  </properties>

  <distributionManagement>
    <repository>
      <id>release-repository</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
    </repository>
    <snapshotRepository>
      <id>snapshot-repository</id>
      <name>Maven2 Snapshot Repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <uniqueVersion>false</uniqueVersion>
    </snapshotRepository>
  </distributionManagement>

  <repositories>
    <repository>
      <id>snapshot-repository</id>
      <name>Maven2 Snapshot Repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
  </repositories>

  <scm>
    <connection>scm:git:git://github.com/hazelcast/hazelcast-kubernetes.git</connection>
    <developerConnection>scm:git:git@github.com:hazelcast/hazelcast-kubernetes.git</developerConnection>
    <url>https://github.com/hazelcast/hazelcast-kubernetes/</url>
    <tag>HEAD</tag>
  </scm>

  <developers>
    <developer>
      <id>cengelbert</id>
      <name>Christoph Engelbert (@noctarius2k)</name>
      <email>noctarius@apache.org</email>
      <timezone>+1</timezone>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>APACHE LICENSE 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>

  <issueManagement>
    <system>github</system>
    <url>https://github.com/hazelcast/hazelcast-kubernetes/issues</url>
  </issueManagement>

  <ciManagement>
    <system>Jenkins</system>
    <url>https://hazelcast-l337.ci.cloudbees.com/job/Kubernetes-pr-builder/</url>
  </ciManagement>

  <dependencies>
    <dependency>
      <groupId>com.hazelcast</groupId>
      <artifactId>hazelcast</artifactId>
      <version>${hazelcast.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>annotations</artifactId>
      <version>3.0.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.hazelcast</groupId>
      <artifactId>hazelcast</artifactId>
      <scope>test</scope>
      <version>${hazelcast.version}</version>
      <classifier>tests</classifier>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.github.tomakehurst</groupId>
      <artifactId>wiremock</artifactId>
      <version>${wiremock.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>${log4j.version}</version>
      <scope>test</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-mockito2</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.4.0</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Export-Package>
              com.hazelcast.kubernetes.*
            </Export-Package>
            <Import-Package>
              com.hazelcast.config,com.hazelcast.config.properties,
              com.hazelcast.spi.discovery,com.hazelcast.core,
              com.hazelcast.logging,com.hazelcast.nio,com.hazelcast.internal.nio, com.hazelcast.internal.util,
              com.hazelcast.internal.json,javax.net.ssl,javax.security.auth.x500,
              javax.naming, javax.naming.directory, com.hazelcast.spi.partitiongroup
            </Import-Package>
          </instructions>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.0</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <show>public</show>
              <sourceFileExcludes>
                <exclude>com/hazelcast/kubernetes/HazelcastKubernetesDiscoveryStrategyFactory.java</exclude>
              </sourceFileExcludes>
              <sourceFileIncludes>
                <include>com/hazelcast/kubernetes/*.java</include>
              </sourceFileIncludes>
              <detectJavaApiLink>true</detectJavaApiLink>
              <links>
                <link>http://docs.hazelcast.org/docs/3.7/javadoc/</link>
              </links>
              <!-- additionalparam>-Xdoclint:none</additionalparam -->
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-scm-publish-plugin</artifactId>
        <version>1.1</version>
        <configuration>
          <checkoutDirectory>${project.build.directory}/scmpublish</checkoutDirectory>
          <checkinComment>Publishing javadoc for ${project.artifactId}:${project.version}</checkinComment>
          <content>${project.build.directory}/apidocs</content>
          <skipDeletedFiles>true</skipDeletedFiles>
          <pubScmUrl>scm:git:git@github.com:hazelcast/hazelcast-kubernetes.git</pubScmUrl>
          <scmBranch>gh-pages</scmBranch>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${maven.checkstyle.plugin.version}</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>checkstyle</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <configLocation>${main.basedir}/checkstyle/checkstyle.xml</configLocation>
          <suppressionsLocation>${main.basedir}/checkstyle/suppressions.xml</suppressionsLocation>
          <headerLocation>${main.basedir}/checkstyle/ClassHeader.txt</headerLocation>
          <enableRSS>false</enableRSS>
          <linkXRef>true</linkXRef>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
          <failOnViolation>true</failOnViolation>
          <includeTestSourceDirectory>false</includeTestSourceDirectory>
          <enableRulesSummary>true</enableRulesSummary>
          <propertyExpansion>main.basedir=${main.basedir}</propertyExpansion>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>${maven.findbugs.plugin.version}</version>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <failOnError>true</failOnError>
          <excludeFilterFile>${main.basedir}/findbugs/findbugs-exclude.xml</excludeFilterFile>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <show>public</show>
          <sourceFileExcludes>
            <exclude>com/hazelcast/kubernetes/HazelcastKubernetesDiscoveryStrategyFactory.java</exclude>
          </sourceFileExcludes>
          <sourceFileIncludes>
            <include>com/hazelcast/kubernetes/*.java</include>
          </sourceFileIncludes>
          <detectJavaApiLink>true</detectJavaApiLink>
          <links>
            <link>http://docs.hazelcast.org/docs/3.7/javadoc/</link>
          </links>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>test-coverage</id>
      <properties>
        <argLine>
          -Xms128m -Xmx1G -XX:MaxPermSize=128M
          -Dhazelcast.version.check.enabled=false
          -Dhazelcast.mancenter.enabled=false
          -Dhazelcast.logging.type=none
          -Dhazelcast.test.use.network=false
        </argLine>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${maven.jacoco.plugin.version}</version>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven.surefire.plugin.version}</version>
            <configuration combine.self="override">
              <redirectTestOutputToFile>true</redirectTestOutputToFile>
              <testFailureIgnore>true</testFailureIgnore>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>sonar-maven-plugin</artifactId>
            <version>${maven.sonar.plugin.version}</version>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <properties>
        <javadoc>true</javadoc>
      </properties>
      <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>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven.javadoc.plugin.version}</version>
            <configuration>
              <javaApiLinks>
                <property>
                  <name>api_1.6</name>
                  <value>http://download.oracle.com/javase/1.6.0/docs/api/</value>
                </property>
                <property>
                  <name>api_1.7</name>
                  <value>http://download.oracle.com/javase/1.7.0/docs/api/</value>
                </property>
              </javaApiLinks>
              <maxmemory>1024</maxmemory>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.3</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>release-repository</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release-snapshot</id>
      <properties>
        <javadoc>true</javadoc>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven.javadoc.plugin.version}</version>
            <configuration>
              <javaApiLinks>
                <property>
                  <name>api_1.6</name>
                  <value>http://download.oracle.com/javase/1.6.0/docs/api/</value>
                </property>
                <property>
                  <name>api_1.7</name>
                  <value>http://download.oracle.com/javase/1.7.0/docs/api/</value>
                </property>
              </javaApiLinks>
              <excludePackageNames>
                *.impl:*.internal:*.operations:*.proxy:*.util:com.hazelcast.aws.security:
                *.handlermigration:*.client.connection.nio:*.client.console:*.buildutils:
                *.client.protocol.generator:*.cluster.client:*.concurrent:*.collection:
                *.nio.ascii:*.nio.ssl:*.nio.tcp:*.partition.client:*.transaction.client:
                *.core.server:com.hazelcast.instance:com.hazelcast.PlaceHolder
              </excludePackageNames>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>master</id>
      <properties>
        <hazelcast.version>4.0-SNAPSHOT</hazelcast.version>
      </properties>
      <dependencies>
        <dependency>
          <groupId>com.hazelcast</groupId>
          <artifactId>hazelcast</artifactId>
          <version>${hazelcast.version}</version>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven.surefire.plugin.version}</version>
            <configuration combine.self="override">
              <parallel>none</parallel>
              <redirectTestOutputToFile>true</redirectTestOutputToFile>
              <argLine>-Xms128m -Xmx1G -XX:MaxPermSize=128M
                -Dhazelcast.phone.home.enabled=false
                -Dhazelcast.mancenter.enabled=false
                -Dhazelcast.logging.type=none
                -Dhazelcast.test.use.network=true
              </argLine>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5</version>
            <dependencies>
              <dependency>
                <groupId>org.apache.maven.scm</groupId>
                <artifactId>maven-scm-provider-gitexe</artifactId>
                <version>1.9.1</version>
              </dependency>
            </dependencies>
            <configuration>
              <suppressCommitBeforeTag>false</suppressCommitBeforeTag>
              <remoteTagging>false</remoteTagging>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>