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

     Copyright 2005-2014 Red Hat, Inc.

     Red Hat licenses this file to you 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>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>9</version>
  </parent>

  <groupId>io.fabric8.jube</groupId>
  <artifactId>parent-project</artifactId>
  <version>2.0.21</version>
  <packaging>pom</packaging>

  <name>Jube :: Parent Project</name>
  <description>Provides a pure Java implementation of a Kubernetes-like container orchestration layer.</description>

  <url>http://jube.io/</url>
  <inceptionYear>2014</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>

  <scm>
    <connection>scm:git:git@github.com:jubeio/jube.git</connection>
    <developerConnection>scm:git:git@github.com:jubeio/jube.git</developerConnection>
    <url>http://github.com/jubeio/jube</url>
    <tag>parent-project-2.0.21</tag>
  </scm>

  <!-- including A developer as it's required by the maven poms going into central -->
  <developers>
    <developer>
      <id>geeks</id>
      <name>Jube Development Team</name>
      <organization>jube</organization>
      <organizationUrl>http://jube.io/</organizationUrl>
    </developer>
  </developers>

  <distributionManagement>
    <repository>
      <id>oss-sonatype-staging</id>
      <name>Sonatype Staging Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
    </repository>
    <snapshotRepository>
      <id>oss-sonatype-snapshots</id>
      <name>OSS Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <!-- maven-compiler-plugin -->
    <maven.compiler.target>1.7</maven.compiler.target>
    <maven.compiler.source>1.7</maven.compiler.source>
    <!--
            Options to override the compiler arguments directly on the compiler arument line to separate between what
            the IDE understands as the source level and what the Maven compiler actually use.
    -->
    <maven.compiler.argument.target>${maven.compiler.target}</maven.compiler.argument.target>
    <maven.compiler.argument.source>${maven.compiler.source}</maven.compiler.argument.source>

    <maven.enforcer.version>3.1.1</maven.enforcer.version>
    <fabric8.version>2.0.21</fabric8.version>
    <hawtio.version>1.4.45</hawtio.version>
    <hawtio.swagger.version>1.0.2</hawtio.swagger.version>
<!--
    <hawtio.swagger.version>1.1.0-SNAPSHOT</hawtio.swagger.version>
-->
    <jetty9.version>9.1.5.v20140505</jetty9.version>
    <karaf.version>2.4.0</karaf.version>
    <tomcat.version>8.0.14</tomcat.version>
    <weld.version>2.2.5.Final</weld.version>

    <!-- maven plugin versions can't be reused via BOM -->
    <buildnumber.plugin.version>1.3</buildnumber.plugin.version>
    <compiler.plugin.version>3.2</compiler.plugin.version>
    <cxf.plugin.version>3.0.2</cxf.plugin.version>
    <docker.maven.plugin.version>0.9.10</docker.maven.plugin.version>
    <exec.maven.plugin.version>1.2.1</exec.maven.plugin.version>
    <jar.plugin.version>2.5</jar.plugin.version>
    <jetty-plugin.version>8.1.14.v20131031</jetty-plugin.version>
    <maven.resources.plugin.version>2.6</maven.resources.plugin.version>
    <maven.surefire.plugin.version>2.17</maven.surefire.plugin.version>
    <maven.checkstyle.plugin.version>2.9.1</maven.checkstyle.plugin.version>
    <maven.checkstyle.version>6.0</maven.checkstyle.version>
    <maven.license.maven.plugin.version>2.6</maven.license.maven.plugin.version>
    <maven.enforcer.plugin.version>1.3.1</maven.enforcer.plugin.version>
    <failIfNoTests>false</failIfNoTests>
  </properties>

  <modules>
    <module>buildingtools</module>
    <module>jube-maven-plugin</module>
    <module>images</module>
    <module>process-manager</module>
    <module>core</module>
    <module>registry-facade</module>
    <module>node</module>
    <module>war</module>
    <module>console</module>
    <module>jube</module>
    <module>itests</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>fabric8-project</artifactId>
        <version>${fabric8.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <defaultGoal>install</defaultGoal>

    <plugins>
      <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-surefire-plugin</artifactId>
          <version>${maven.surefire.plugin.version}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <preparationGoals>clean install</preparationGoals>
          <developmentVersion>2.0-SNAPSHOT</developmentVersion>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>1.5</version>
        <configuration>
          <passphrase>${gpg.passphrase}</passphrase>
          <useAgent>true</useAgent>
        </configuration>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.5.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${maven.checkstyle.plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>${maven.checkstyle.version}</version>
              <exclusions>
                <exclusion>
                  <groupId>com.sun</groupId>
                  <artifactId>tools</artifactId>
                </exclusion>
              </exclusions>
            </dependency>
            <dependency>
              <groupId>io.fabric8.jube</groupId>
              <artifactId>jube-buildtools</artifactId>
              <version>${project.version}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>validate</id>
              <phase>validate</phase>
              <configuration>
                <configLocation>jube-checkstyle.xml</configLocation>
                <consoleOutput>true</consoleOutput>
                <failsOnError>true</failsOnError>
                <linkXRef>false</linkXRef>
                <suppressionsLocation>jube-checkstyle-suppressions.xml</suppressionsLocation>
                <encoding>UTF-8</encoding>
                <sourceDirectory>${basedir}/src</sourceDirectory>
                <excludes>**/archetype-resources/**/*.java</excludes>
              </configuration>
              <goals>
                <goal>checkstyle</goal>
              </goals>
            </execution>
          </executions>
        </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.enforcer.version}</version>
                  </requireMavenVersion>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>fabric8-snapshot</id>
      <properties>
        <fabric8.version>2.2-SNAPSHOT</fabric8.version>
      </properties>
    </profile>
    <profile>
        <id>hawtio-snapshot</id>
        <properties>
            <hawtio.version>1.5-SNAPSHOT</hawtio.version>
        </properties>
    </profile>

    <profile>
      <id>sourcecheck</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>license</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <version>${maven.license.maven.plugin.version}</version>
            <configuration>
              <includes>
                <include>src/main/java/**</include>
                <include>src/test/java/**</include>
                <include>pom.xml</include>
                <include>**/*.xml</include>
                <include>**/*.cfg</include>
                <include>**/*.properties</include>
              </includes>
              <excludes>
                <!-- exclude sample data -->
                <exclude>**/src/data/**</exclude>
                <exclude>**/resources/data/**</exclude>
                <!-- exclude hidden dir -->
                <exclude>**/.*/**</exclude>
              </excludes>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
