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

    Copyright (C) 2015 Red Hat, 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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.fabric8</groupId>
    <artifactId>kubernetes-client-project</artifactId>
    <version>4.1.1</version>
  </parent>

  <artifactId>kubernetes-model-generator</artifactId>
  <packaging>pom</packaging>

  <name>Fabric8 :: Kubernetes Model Parent</name>

  <properties>

    <!-- should we include the integration test in this build? -->
    <itest>true</itest>

    <skipTests>false</skipTests>
    <testExclusionPattern>**/*KubernetesTest.java</testExclusionPattern>

    <buildnumber.plugin.version>1.4</buildnumber.plugin.version>
    <compiler.plugin.version>3.5.1</compiler.plugin.version>
    <jar.plugin.version>3.0.1</jar.plugin.version>
    <deploy.plugin.version>2.8.2</deploy.plugin.version>
    <maven.compiler.argument.target>${maven.compiler.target}</maven.compiler.argument.target>
    <maven.compiler.argument.source>${maven.compiler.source}</maven.compiler.argument.source>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
    <maven.enforcer.plugin.version>1.4.1</maven.enforcer.plugin.version>

    <exec-maven-plugin.version>1.5.0</exec-maven-plugin.version>
    <jackson2.version>2.7.5</jackson2.version>
    <jsonschema2pojo.version>0.4.23</jsonschema2pojo.version>
    <junit.version>4.12</junit.version>
    <validation-api.version>1.1.0.Final</validation-api.version>
    <lombok.version>1.16.10</lombok.version>
  </properties>

  <modules>
    <module>kubernetes-model-annotator</module>
    <module>kubernetes-model</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.fasterxml.jackson.module</groupId>
        <artifactId>jackson-module-jaxb-annotations</artifactId>
        <version>${jackson2.version}</version>
      </dependency>
      <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>${validation-api.version}</version>
      </dependency>
      <dependency>
        <groupId>io.sundr</groupId>
        <artifactId>builder-annotations</artifactId>
        <version>${sundrio.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
      </dependency>
      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>${lombok.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>${deploy.plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${compiler.plugin.version}</version>
        <configuration>
          <showDeprecation>true</showDeprecation>
          <showWarnings>true</showWarnings>
          <compilerArguments>
            <source>${maven.compiler.argument.source}</source>
            <target>${maven.compiler.argument.target}</target>
          </compilerArguments>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${jar.plugin.version}</version>
        <configuration>
          <archive>
            <index>true</index>
            <manifest>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
              <Implementation-URL>${project.url}</Implementation-URL>
              <Java-Version>${java.version}</Java-Version>
              <Java-Vendor>${java.vendor}</Java-Vendor>
              <Os-Name>${os.name}</Os-Name>
              <Os-Arch>${os.arch}</Os-Arch>
              <Os-Version>${os.version}</Os-Version>
              <Scm-Url>${project.scm.url}</Scm-Url>
              <Scm-Connection>${project.scm.connection}</Scm-Connection>
              <Scm-Revision>${buildNumber}</Scm-Revision>
              <Build-Timestamp>${build.datetime}</Build-Timestamp>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <!-- Set properties containing the scm revision and build timestamp -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>${buildnumber.plugin.version}</version>
        <executions>
          <execution>
            <id>get-build-timestamp</id>
            <phase>initialize</phase>
            <goals>
              <goal>create-timestamp</goal>
            </goals>
            <configuration>
              <!-- Example date: Wed, 4 Jul 2001 12:08:56 -0700 -->
              <timestampFormat>EEE, d MMM yyyy HH:mm:ss Z</timestampFormat>
              <timestampPropertyName>build.datetime</timestampPropertyName>
            </configuration>
          </execution>
          <execution>
            <id>get-scm-revision</id>
            <phase>initialize</phase>
            <goals>
              <goal>create</goal>
            </goals>
            <configuration>
              <doCheck>false</doCheck>
              <doUpdate>false</doUpdate>
              <revisionOnScmFailure>UNKNOWN</revisionOnScmFailure>
              <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <nonFilteredFileExtensions>
            <nonFilteredFileExtension>zip</nonFilteredFileExtension>
            <nonFilteredFileExtension>gz</nonFilteredFileExtension>
            <nonFilteredFileExtension>jar</nonFilteredFileExtension>
          </nonFilteredFileExtensions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${maven.enforcer.plugin.version}</version>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>${maven.version}</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
	<version>${maven.surefire.plugin.version}</version>
        <inherited>true</inherited>
        <configuration>
          <skipTests>${skipTests}</skipTests>
          <excludes>
            <exclude>${testExclusionPattern}</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>site</id>
      <modules>
        <module>website</module>
      </modules>
    </profile>
    <profile>
      <id>distro</id>
      <modules>
      </modules>
    </profile>
    <profile>
      <id>itest</id>
      <activation>
        <property>
          <name>itest</name>
          <value>true</value>
        </property>
      </activation>
      <modules>
        <module>model-generator-app</module>
      </modules>
    </profile>
    <profile>
      <id>doclint-java8-disable</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <properties>
        <javadoc.opts>-Xdoclint:none</javadoc.opts>
      </properties>
    </profile>
  </profiles>
</project>
