<!--

     Copyright 2005-2015 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.devops.apps</groupId>
  <artifactId>fabric8-devops</artifactId>
  <version>2.2.335</version>
  <packaging>pom</packaging>

  <name>Fabric8 DevOps</name>

  <url>http://fabric8.io/</url>
  <inceptionYear>2015</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>

  <prerequisites>
    <maven>3.2.1</maven>
  </prerequisites>

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

  <scm>
    <connection>scm:git:git@github.com:fabric8io/fabric8-devops.git</connection>
    <developerConnection>scm:git:git@github.com:fabric8io/fabric8-devops.git</developerConnection>
    <url>http://github.com/fabric8io/fabric8-devops</url>
    <tag>fabric8-devops-2.0.1</tag>
  </scm>

  <properties>
    <skipTests>false</skipTests>
    <skipItests>true</skipItests>
    <integrationTestPattern>**/*KubernetesTest*.java</integrationTestPattern>

    <docker.from>docker.io/fabric8/java</docker.from>

    <artifact.image.name>${fabric8.dockerUser}${project.artifactId}:${project.version}</artifact.image.name>
    <docker.assemblyDescriptorRef>artifact-with-dependencies</docker.assemblyDescriptorRef>

    <!-- lets disable S2I for our releases -->
    <fabric8.mode>kubernetes</fabric8.mode>

    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>

    <arquillian.version>1.1.8.Final</arquillian.version>
    <caddy-server.version>v9274a15</caddy-server.version>
    <commons.beanutils.version>1.9.2</commons.beanutils.version>
    <docker.assembly.exportBaseDir>false</docker.assembly.exportBaseDir>
    <!-- TODO this can be removed once we upgrade the docker maven plugin -->
    <docker.assembly.exportBase>false</docker.assembly.exportBase>
    <docker.maven.plugin.version>0.15.9</docker.maven.plugin.version>
    <fabric8.dockerUser>fabric8/</fabric8.dockerUser>

    <gitective-version>0.9.11</gitective-version>
    <gofabric8.version>0.4.133</gofabric8.version>
    <jcraft-jzlib-version>1.1.3</jcraft-jzlib-version>
    <junit.version>4.12</junit.version>

    <fabric8.version>2.3.0</fabric8.version>
    <fabric8.release.version>${fabric8.version}</fabric8.release.version>

    <fabric8.maven.plugin.version>3.5.0</fabric8.maven.plugin.version>
    <fabric8.maven.plugin.majorVersion>3</fabric8.maven.plugin.majorVersion>

    <exec-maven-plugin.version>1.2.1</exec-maven-plugin.version>
    <maven.enforcer.plugin.version>1.4</maven.enforcer.plugin.version>
    <maven.javadoc.plugin.version>2.10.3</maven.javadoc.plugin.version>
    <maven.require.version>3.1.1</maven.require.version>
    <maven-resources-plugin.version>2.6</maven-resources-plugin.version>
    <maven.surefire.plugin.version>2.17</maven.surefire.plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <version.maven-bundle-plugin>2.3.7</version.maven-bundle-plugin>
    <version.compiler.plugin>2.3.1</version.compiler.plugin>

    <configmapcontroller.version>2.3.7</configmapcontroller.version>
    <exposecontroller.version>2.3.16</exposecontroller.version>
    <jenkins-openshift.version>v14e753c</jenkins-openshift.version>
    <sonarqube.version>v4c88694</sonarqube.version>
  </properties>

  <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>

  <repositories>
    <repository>
      <id>oss-sonatype-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
      <name>OSS Sonatype Nexus Snapshots</name>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>oss-sonatype-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
      <name>OSS Sonatype Nexus Snapshots</name>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

  <modules>
    <module>artifactory</module>
    <module>brackets</module>
    <module>chaos-monkey</module>
    <module>collector-utils</module>
    <module>configmapcontroller</module>
    <module>content-repository</module>
    <module>elasticsearch</module>
    <module>exposecontroller</module>
    <module>fabric8-docker-registry</module>
    <module>fluentd</module>
    <module>gerrit</module>
    <module>gitlab</module>
    <module>git-collector</module>
    <module>gogs</module>
    <module>grafana</module>
    <module>hubot-irc</module>
    <module>hubot-letschat</module>
    <module>hubot-mattermost</module>
    <module>hubot-notifier</module>
    <module>hubot-slack</module>
    <module>image-linker</module>
    <module>ingress-nginx</module>
    <module>jenkins</module>
    <module>jenkins-openshift</module>
    <module>keycloak</module>
    <module>kibana</module>
    <module>kiwiirc</module>
    <module>letschat</module>
    <module>manageiq</module>
    <module>maven-shell</module>
    <module>nexus</module>
    <module>nexus3</module>
    <module>orion</module>
    <module>prometheus</module>
    <module>prometheus-blackbox-exporter</module>
    <module>prometheus-node-exporter</module>
    <module>sonarqube</module>
    <module>taiga</module>
    <module>upgrade-job</module>
    <module>validator-job</module>
    <module>packages</module>
  </modules>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven.javadoc.plugin.version}</version>
          <configuration>
            <additionalparam>${javadoc.opts}</additionalparam>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <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.require.version}</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <releaseProfiles>docker-push,docker-public</releaseProfiles>
        </configuration>
      </plugin>
      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>fabric8-maven-plugin</artifactId>
        <version>${fabric8.maven.plugin.version}</version>
        <executions>
          <execution>
            <id>fmp</id>
            <goals>
              <goal>resource</goal>
              <goal>helm</goal>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.17</version>
        <inherited>true</inherited>
        <configuration>
          <skipTests>${skipTests}</skipTests>
          <excludes>
            <exclude>${integrationTestPattern}</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <id>int-test</id>
            <goals>
              <goal>test</goal>
            </goals>
            <phase>integration-test</phase>
            <configuration>
              <skipTests>${skipItests}</skipTests>
              <excludes>
                <exclude>none</exclude>
              </excludes>
              <includes>
                <include>${integrationTestPattern}</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>fabric8-project</artifactId>
        <version>${fabric8.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <version>${arquillian.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>fabric8-arquillian</artifactId>
        <version>${fabric8.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-assertions</artifactId>
        <version>${fabric8.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <profile>
      <id>systests</id>
      <modules>
        <module>systests</module>
      </modules>
    </profile>
    <profile>
      <id>fabric8-snapshot</id>
      <properties>
        <fabric8.version>2.2-SNAPSHOT</fabric8.version>

        <!-- this must be the last released version - cannot be a snapshot -->
        <fabric8.release.version>2.2.81</fabric8.release.version>
        <fabric8.dockerPrefix/>
      </properties>
    </profile>

    <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>${maven.enforcer.plugin.version}</version>
            <executions>
              <execution>
                <id>enforce-no-snapshots</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireReleaseDeps>
                      <message>No Snapshots Allowed!</message>
                    </requireReleaseDeps>
                  </rules>
                  <fail>true</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <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>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>fabric8-maven-plugin</artifactId>
            <version>${fabric8.maven.plugin.version}</version>
            <executions>
              <execution>
                <id>fmp</id>
                <goals>
                  <goal>resource</goal>
                  <goal>helm</goal>
                  <goal>build</goal>
                  <goal>push</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>license</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <version>2.6</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 sampel 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>
    <profile>
      <id>doclint-java8-disable</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <properties>
        <javadoc.opts>-Xdoclint:none</javadoc.opts>
      </properties>
    </profile>
  </profiles>
</project>
