<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <artifactId>dekorate-project</artifactId>
    <groupId>io.dekorate</groupId>
    <version>0.10.10.redhat-00001</version>
  </parent>
  <groupId>io.dekorate</groupId>
  <artifactId>dekorate-dependencies</artifactId>
  <name>Dekorate :: Dependencies Uberjar</name>
  <packaging>jar</packaging>
  <url>http://dekorate.io/</url>
  <inceptionYear>2018</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.me/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:dekorate/dependencies.git</connection>
    <developerConnection>scm:git:git@github.com:dekorate/dependencies.git</developerConnection>
    <url>http://github.com/dekorate/dependencies</url>
    <tag>0.10.10</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>
  </distributionManagement>

  <properties>
    <version.commons-codec>1.10.0.redhat-5</version.commons-codec>
    <version.commons-compress>1.18.0.redhat-00001</version.commons-compress>
    <version.jansi>1.18.0.redhat-00001</version.jansi>
    <version.jackson>2.9.7</version.jackson>
    <version.kubernetes-client>4.7.0</version.kubernetes-client>
    <version.application-crd-client>1.1.1</version.application-crd-client>
    <version.slf4j>1.7.13</version.slf4j>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>kubernetes-model</artifactId>
       <version>${version.kubernetes-client}</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>kubernetes-client</artifactId>
      <version>${version.kubernetes-client}</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>openshift-client</artifactId>
      <version>${version.kubernetes-client}</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>knative-client</artifactId>
      <version>${version.kubernetes-client}</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>
    
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>servicecatalog-model</artifactId>
      <version>${version.kubernetes-client}</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>servicecatalog-client</artifactId>
      <version>${version.kubernetes-client}</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>me.snowdrop</groupId>
      <artifactId>application-crd-model</artifactId>
      <version>${version.application-crd-client}</version>
      <scope>compile</scope>
      <optional>true</optional>
     </dependency>

     <dependency>
      <groupId>me.snowdrop</groupId>
      <artifactId>application-crd-client</artifactId>
      <version>${version.application-crd-client}</version>
      <scope>compile</scope>
      <optional>true</optional>
     </dependency>

     <dependency>
       <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
       <version>${version.slf4j}</version>
     </dependency>

    <!-- Compression -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-compress</artifactId>
      <version>${version.commons-compress}</version>
    </dependency>
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>${version.commons-codec}</version>
    </dependency>
    <!-- Serialization  -->
    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-yaml</artifactId>
      <version>2.9.7.redhat-00001</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-properties</artifactId>
      <version>2.9.7.redhat-00001</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>    
    <!-- Misc -->
   <dependency>
      <groupId>org.fusesource.jansi</groupId>
      <artifactId>jansi</artifactId>
      <version>${version.jansi}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>relocation</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <artifactSet>
                <includes>
                  <include>io.fabric8:zjsonpatch</include>
                  <include>io.fabric8:kubernetes-model</include>
                  <include>io.fabric8:kubernetes-client</include>
                  <include>io.fabric8:openshift-client</include>
                  <include>io.fabric8:knative-model</include>
                  <include>io.fabric8:knative-client</include>
                  <include>io.fabric8:servicecatalog-model</include>
                  <include>io.fabric8:servicecatalog-client</include>
                  <include>me.snowdrop:application-crd-model</include>
                  <include>me.snowdrop:application-crd-client</include>

                  <include>org.apache.commons:commons-compress</include>
                  <include>commons-codec:commons-codec</include>

                  <include>com.squareup.okhttp3:okhttp</include>
                  <include>com.squareup.okhttp3:okhttp-ws</include>
                  <include>com.squareup.okhttp3:logging-interceptor</include>
                  <include>com.squareup.okio:okio</include>

                  <include>javax.validation:validation-api</include>
                  <include>com.fasterxml.jackson.core:jackson-annotations</include>
                  <include>com.fasterxml.jackson.core:jackson-core</include>
                  <include>com.fasterxml.jackson.core:jackson-databind</include>
                  <include>com.fasterxml.jackson.dataformat:jackson-dataformat-yaml</include>
                  <include>com.fasterxml.jackson.dataformat:jackson-dataformat-properties</include>
                  <include>org.yaml:snakeyaml</include>
                  <include>org.fusesource.jansi:jansi</include>

                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>io.fabric8.kubernetes</pattern>
                  <shadedPattern>io.dekorate.deps.kubernetes</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.fabric8.openshift</pattern>
                  <shadedPattern>io.dekorate.deps.openshift</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.fabric8.knative</pattern>
                  <shadedPattern>io.dekorate.deps.knative</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.fabric8.servicecatalog</pattern>
                  <shadedPattern>io.dekorate.deps.servicecatalog</shadedPattern>
                </relocation>
                 <relocation>
                    <pattern>me.snowdrop.applicationcrd</pattern>
                    <shadedPattern>io.dekorate.deps.applicationcrd</shadedPattern>
                 </relocation>
                <relocation>
                  <pattern>io.fabric8.zjsonpatch</pattern>
                  <shadedPattern>io.dekorate.deps.zjsonpatch</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.commons</pattern>
                  <shadedPattern>io.dekorate.deps.commons</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>okio</pattern>
                  <shadedPattern>io.dekorate.deps.okio</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>okhttp3</pattern>
                  <shadedPattern>io.dekorate.deps.okhttp3</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.fasterxml.jackson</pattern>
                  <shadedPattern>io.dekorate.deps.jackson</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.yaml.snakeyaml</pattern>
                  <shadedPattern>io.dekorate.deps.snakeyaml</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>javax.validation</pattern>
                  <shadedPattern>io.dekorate.deps.javax.validation</shadedPattern>
                </relocation>
                <relocation>
                    <pattern>org.fusesource.jansi</pattern>
                    <shadedPattern>io.dekorate.deps.jansi</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"></transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </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>
                            </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>false</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.3</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>2.4</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</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>
