<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.microbean</groupId>
  <artifactId>microbean-helm</artifactId>
  <version>2.7.2.1.0.0</version>

  <parent>
    <groupId>org.microbean</groupId>
    <artifactId>microbean-pluginmanagement-pom</artifactId>
    <version>5</version>
  </parent>

  <name>microBean Helm</name>
  <description>Java bindings for the Helm API</description>
  <inceptionYear>2017</inceptionYear>
  <url>https://microbean.github.io/${project.artifactId}</url>

  <scm>
    <connection>scm:git:git@github.com:microbean/${project.artifactId}.git</connection>
    <developerConnection>scm:git:git@github.com:microbean/${project.artifactId}.git</developerConnection>
    <url>https://github.com/microbean/${project.artifactId}/</url>
    <tag>v2.7.2.1.0.0</tag>
  </scm>

  <issueManagement>
    <system>Github</system>
    <url>https://github.com/microbean/${project.artifactId}/issues/</url>
  </issueManagement>

  <!--

     For more on the structure of this pom.xml file, which is chiefly
     concerned with downloading some .proto meta-source files,
     generating Java source code from them, and compiling the
     resulting source code, see the following links:

       * https://www.xolstice.org/protobuf-maven-plugin/:
         The Maven plugin for working with Google's protocol buffers.

       * https://github.com/grpc/grpc-java#download:
         Documentation for the grpc-java protoc plugin.

  -->
  
  <dependencyManagement>
    <dependencies>

      <dependency>
        <groupId>com.github.zafarkhaja</groupId>
        <artifactId>java-semver</artifactId>
        <version>0.9.0</version>
        <type>jar</type>
      </dependency>
      
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>3.4.0</version>
        <type>jar</type>
      </dependency>

      <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-netty</artifactId>
        <version>1.7.0</version>
        <type>jar</type>
      </dependency>
      
      <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-protobuf</artifactId>
        <version>1.7.0</version>
        <type>jar</type>
      </dependency>
      
      <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-stub</artifactId>
        <version>1.7.0</version>
        <type>jar</type>
      </dependency>

      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-client</artifactId>
        <version>3.0.0</version>
        <type>jar</type>
      </dependency>

      <!-- See https://github.com/grpc/grpc-java/blob/master/SECURITY.md#openssl-statically-linked-netty-tcnative-boringssl-static -->
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-tcnative-boringssl-static</artifactId>
        <version>2.0.5.Final</version>
        <type>jar</type>
        <classifier>${os.detected.classifier}</classifier>
      </dependency>

      <dependency>
        <groupId>org.kamranzafar</groupId>
        <artifactId>jtar</artifactId>
        <version>2.3</version>
        <type>jar</type>
      </dependency>

      <dependency>
        <groupId>org.microbean</groupId>
        <artifactId>microbean-development-annotations</artifactId>
        <version>0.1.2</version>
        <type>jar</type>
      </dependency>
      
      <dependency>
        <groupId>org.microbean</groupId>
        <artifactId>microbean-kubernetes</artifactId>
        <version>0.1.1</version>
        <type>jar</type>
      </dependency>
      
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.7.25</version>
        <type>jar</type>
      </dependency>

      <dependency>
        <groupId>org.yaml</groupId>
        <artifactId>snakeyaml</artifactId>
        <version>1.19</version>
        <type>jar</type>
      </dependency>
      
    </dependencies>
  </dependencyManagement>

  <dependencies>

    <!-- Compile-scoped dependencies. -->

    <dependency>
      <groupId>com.github.zafarkhaja</groupId>
      <artifactId>java-semver</artifactId>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>kubernetes-client</artifactId>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-netty</artifactId>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-protobuf</artifactId>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-stub</artifactId>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.kamranzafar</groupId>
      <artifactId>jtar</artifactId>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.microbean</groupId>
      <artifactId>microbean-development-annotations</artifactId>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>
    
    <dependency>
      <groupId>org.microbean</groupId>
      <artifactId>microbean-kubernetes</artifactId>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.yaml</groupId>
      <artifactId>snakeyaml</artifactId>
      <type>jar</type>
      <scope>compile</scope>
    </dependency>

    <!-- Runtime-scoped dependencies. -->

    <!-- See https://github.com/grpc/grpc-java/blob/master/SECURITY.md#openssl-statically-linked-netty-tcnative-boringssl-static -->
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-tcnative-boringssl-static</artifactId>
      <type>jar</type>
      <classifier>${os.detected.classifier}</classifier>
      <scope>runtime</scope>
    </dependency>
    
    <!-- Test-scoped dependencies. -->
    
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <type>jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <type>jar</type>
      <scope>test</scope>
    </dependency>
    
  </dependencies>
  
  <build>

    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>1.5.0.Final</version>
      </extension>
    </extensions>

    <resources>

      <resource>
        <directory>src/main/resources</directory>
      </resource>
      
      <resource>
        <targetPath>META-INF</targetPath>
        <directory />
        <includes>
          <include>LICENSE</include>
        </includes>
      </resource>

    </resources>

    <testResources />
    
    <pluginManagement>
      <plugins>

        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <offlineLinks>
              <offlineLink>
                <url>http://static.javadoc.io/com.github.zafarkhaja/java-semver/0.9.0</url>
                <location>${project.basedir}/src/main/javadoc/com.github.zafarkhaja/java-semver/0.9.0</location>
              </offlineLink>
              <offlineLink>
                <url>http://static.javadoc.io/io.fabric8/kubernetes-client/3.0.0</url>
                <location>${project.basedir}/src/main/javadoc/io.fabric8/kubernetes-client/3.0.0</location>
              </offlineLink>
              <offlineLink>
                <url>http://static.javadoc.io/io.fabric8/kubernetes-model/1.1.4</url>
                <location>${project.basedir}/src/main/javadoc/io.fabric8/kubernetes-model/1.1.4</location>
              </offlineLink>
              <offlineLink>
                <url>http://static.javadoc.io/org.kamranzafar/jtar/2.3</url>
                <location>${project.basedir}/src/main/javadoc/org.kamranzafar/jtar/2.3</location>
              </offlineLink>
              <offlineLink>
                <url>http://static.javadoc.io/org.yaml/snakeyaml/1.19</url>
                <location>${project.basedir}/src/main/javadoc/org.yaml/snakeyaml/1.19</location>
              </offlineLink>
            </offlineLinks>
          </configuration>
        </plugin>
        
        <plugin>
          <artifactId>maven-scm-plugin</artifactId>
          <version>1.9.5</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <version>3.0.4</version>
        </plugin>
        
        <plugin>
          <groupId>org.jboss.jandex</groupId>
          <artifactId>jandex-maven-plugin</artifactId>
          <version>1.0.5</version>
        </plugin>

        <plugin>
          <groupId>org.xolstice.maven.plugins</groupId>
          <artifactId>protobuf-maven-plugin</artifactId>
          <version>0.5.0</version>
        </plugin>
        
      </plugins>
    </pluginManagement>
    
    <plugins>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgs>
            <arg>-Xlint</arg>
            <arg>-Xlint:-cast</arg>
            <arg>-Xlint:-deprecation</arg>
          </compilerArgs>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>Copy test resources</id>
            <phase>process-test-resources</phase>
            <goals>
              <goal>resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
              <includeEmptyDirectories>true</includeEmptyDirectories>
              <resources>
                <resource>
                  <directory>src/test/resources</directory>
                  <filtering>false</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <artifactId>maven-scm-plugin</artifactId>
        <executions>
          <execution>
            <id>Checkout Helm Protocol Buffers source code</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>checkout</goal>
            </goals>
            <configuration>
              <checkoutDirectory>${project.build.directory}/generated-sources/helm</checkoutDirectory>
              <connectionUrl>scm:git:https://github.com/kubernetes/helm.git</connectionUrl>
              <includes>_proto/hapi/**</includes>
              <scmVersion>v2.7.2</scmVersion>
              <scmVersionType>tag</scmVersionType>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <project.build.directory>${project.build.directory}</project.build.directory>
            <org.slf4j.simpleLogger.log.io.fabric8>info</org.slf4j.simpleLogger.log.io.fabric8>
            <skipInstallationTest>${skipInstallationTest}</skipInstallationTest>
            <skipClusterTests>${skipClusterTests}</skipClusterTests>
            <skipTests>${skipTests}</skipTests>
            <testGetRelease.releaseName>${testGetRelease.releaseName}</testGetRelease.releaseName>
          </systemPropertyVariables>
        </configuration>
        <executions>
          <execution>
            <id>default-test</id>
            <configuration>
              <excludes>
                <exclude>org/microbean/helm/chart/TestHelmIgnorePathMatcher.java</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <groupId>com.github.github</groupId>
        <artifactId>site-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>Generate Java from protocol buffers</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>compile</goal>
              <goal>compile-custom</goal>
            </goals>
            <configuration>
              <checkStaleness>true</checkStaleness>
              <pluginArtifact>io.grpc:protoc-gen-grpc-java:1.7.0:exe:${os.detected.classifier}</pluginArtifact>
              <pluginId>grpc-java</pluginId>
              <protoSourceRoot>${project.build.directory}/generated-sources/helm/_proto</protoSourceRoot>
              <protocArtifact>com.google.protobuf:protoc:3.4.0:exe:${os.detected.classifier}</protocArtifact>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
    </plugins>
  </build>

  <properties>

    <!-- findbugs-maven-plugin properties; see http://gleclaire.github.io/findbugs-maven-plugin/findbugs-mojo.html -->
    <findbugs.effort>Max</findbugs.effort>
    <findbugs.excludeFilterFile>src/findbugs/exclude.xml</findbugs.excludeFilterFile>
    <findbugs.threshold>Medium</findbugs.threshold>

    <!-- maven-javadoc-plugin properties; see https://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html -->
    <doctitle>&lt;a href="${project.url}" target="_parent"&gt;${project.artifactId}&lt;/a&gt; ${project.version} &lt;a href="https://travis-ci.org/microbean/${project.artifactId}" target="_parent"&gt;&lt;img src="https://travis-ci.org/microbean/${project.artifactId}.svg?branch=master"&gt;&lt;/a&gt;</doctitle>
    <links>http://www.grpc.io/grpc-java/javadoc/,https://developers.google.com/protocol-buffers/docs/reference/java/,https://google.github.io/guava/releases/19.0/api/docs/,https://microbean.github.io/microbean-kubernetes/apidocs/,https://microbean.github.io/microbean-development-annotations/apidocs/</links>
    
    <!-- maven-release-plugin properties; see http://maven.apache.org/maven-release/maven-release-plugin/perform-mojo.html -->
    <goals>deploy,site-deploy</goals>
    <scmCommentPrefix>[maven-release-plugin] [skip ci]</scmCommentPrefix>

    <!-- maven-scm-plugin properties; see http://maven.apache.org/components/scm/maven-scm-plugin/checkout-mojo.html -->
    <skipCheckoutIfExists>true</skipCheckoutIfExists>

    <!-- maven-surefire-plugin properties; see http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html -->
    <trimStackTrace>false</trimStackTrace>

    <skipClusterTests>true</skipClusterTests>
    <skipInstallationTest>true</skipInstallationTest>
    
  </properties>

  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <doclint>-missing</doclint>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>Run TestHelmIgnorePathMatcher only</id>
      <activation>
        <property>
          <name>!test</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>Run TestHelmIgnorePathMatcher only</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <includes>
                    <include>org/microbean/helm/chart/TestHelmIgnorePathMatcher.java</include>
                  </includes>
                  <workingDirectory>${project.build.testOutputDirectory}/TestHelmIgnorePathMatcher</workingDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  
</project>
