<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>io.radanalytics</groupId>
    <artifactId>operator-parent-pom</artifactId>
    <version>0.3.7</version>
    <packaging>pom</packaging>
    <name>Operator Parent POM</name>
    <description>parent pom.xml file that is supposed to be reused as parent pom in custom operators</description>
    <url>https://github.com/jvm-operators/operator-parent-pom</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Jiri Kremser</name>
            <email>jkremser@redhat.com</email>
            <organization>Red Hat, Inc.</organization>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/jvm-operators/operator-parent-pom</url>
        <connection>scm:git:git@github.com:jvm-operators/operator-parent-pom.git</connection>
        <developerConnection>scm:git:git@github.com:jvm-operators/operator-parent-pom.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <repositories>
        <repository>
            <id>sonatype-releases</id>
            <url>https://oss.sonatype.org/content/repositories/releases</url>
        </repository>
        <repository>
            <id>sonatype-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>
    </repositories>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <maven.assembly.version>3.1.0</maven.assembly.version>
        <maven.buildnumber.version>1.4</maven.buildnumber.version>
        <maven.compilerplugin.version>3.8.0</maven.compilerplugin.version>
        <maven.failsafe.version>2.20.1</maven.failsafe.version>
        <maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
        <maven.jackson-databind.version>2.7.9.4</maven.jackson-databind.version>
        <maven.jackson-core.version>2.7.9</maven.jackson-core.version>
        <maven.javadoc.plugin.version>3.0.1</maven.javadoc.plugin.version>
        <maven.source.plugin.version>3.0.1</maven.source.plugin.version>
        <maven.jarplugin.version>3.1.0</maven.jarplugin.version>
        <maven.nexus.staging.version>1.6.8</maven.nexus.staging.version>
        <maven.shade.version>3.1.1</maven.shade.version>
        <maven.surefire.version>2.20.1</maven.surefire.version>
        <jsonschema2pojo-maven-plugin>0.5.1</jsonschema2pojo-maven-plugin>

        <jacoco.version>0.7.9</jacoco.version>
        <jcabi.version>1.1</jcabi.version>
        <license.maven.version>2.11</license.maven.version>

        <commons-collections.version>3.2.2</commons-collections.version>
        <commons-lang.version>2.6</commons-lang.version>
        <fabric8.kubernetes-client.version>4.0.5</fabric8.kubernetes-client.version>
        <fabric8.kubernetes-model.version>3.0.3</fabric8.kubernetes-model.version>
        <fabric8.zjsonpatch.version>0.3.0</fabric8.zjsonpatch.version>
        <guava.version>22.0</guava.version>
        <snakeyaml.version>1.23</snakeyaml.version>
        <reflections.version>0.9.11</reflections.version>
        <slf4j.version>1.7.25</slf4j.version>
        <junit.version>4.12</junit.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>${commons-collections.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>${commons-lang.version}</version>
            </dependency>
            <dependency>
                <groupId>io.fabric8</groupId>
                <artifactId>kubernetes-client</artifactId>
                <version>${fabric8.kubernetes-client.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-databind</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>commons-collections</groupId>
                        <artifactId>commons-collections</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${maven.jackson-databind.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${maven.jackson-core.version}</version>
            </dependency>
            <dependency>
                <groupId>io.fabric8</groupId>
                <artifactId>kubernetes-model</artifactId>
                <version>${fabric8.kubernetes-model.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>${snakeyaml.version}</version>
            </dependency>
            <dependency>
                <groupId>com.jcabi</groupId>
                <artifactId>jcabi-manifests</artifactId>
                <version>${jcabi.version}</version>
            </dependency>
            <dependency>
                <groupId>org.reflections</groupId>
                <artifactId>reflections</artifactId>
                <version>${reflections.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>buildnumber-maven-plugin</artifactId>
                    <version>${maven.buildnumber.version}</version>
                    <executions>
                        <execution>
                            <phase>validate</phase>
                            <goals>
                                <goal>create</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <shortRevisionLength>8</shortRevisionLength>
                        <doCheck>false</doCheck>
                        <doUpdate>false</doUpdate>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven.jarplugin.version}</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>false</addDefaultSpecificationEntries>
                            </manifest>
                            <manifestEntries>
                                <Implementation-Build>${buildNumber}</Implementation-Build>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven.shade.version}</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <createDependencyReducedPom>false</createDependencyReducedPom>
                                <transformers>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                        <mainClass>io.radanalytics.operator.Entrypoint</mainClass>
                                    </transformer>
                                </transformers>
                                <filters>
                                    <filter>
                                        <artifact>io.fabric8:openshift-client</artifact>
                                        <excludes>
                                            <exclude>io/fabric8/kubernetes/client/Config*</exclude>
                                        </excludes>
                                    </filter>
                                </filters>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compilerplugin.version}</version>
                    <configuration>
                        <compilerArgs>
                            <!--<arg>-verbose</arg>-->
                            <arg>-Xlint:unchecked</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven.source.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven.javadoc.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <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.jsonschema2pojo</groupId>
                    <artifactId>jsonschema2pojo-maven-plugin</artifactId>
                    <version>${jsonschema2pojo-maven-plugin}</version>
                    <configuration>
                        <sourceDirectory>${basedir}/src/main/resources/schema</sourceDirectory>
                        <targetPackage>io.radanalytics.types</targetPackage>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${maven.nexus.staging.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        <skipStaging>true</skipStaging>
                        <tags>
                            <localUsername>${env.USER}</localUsername>
                            <artifactVersion>${project.version}</artifactVersion>
                        </tags>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
    <profiles>
        <profile>
            <id>release</id>
            <properties>
                <createChecksum>true</createChecksum>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
