<!--

     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.ipaas.apps</groupId>
    <artifactId>fabric8-ipaas</artifactId>
    <version>2.2.168</version>
    <packaging>pom</packaging>

    <name>Fabric8 iPaaS Apps</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>
            <organization>fabric8</organization>
            <organizationUrl>http://fabric8.io/</organizationUrl>
        </developer>
    </developers>

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

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

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

        <!-- upstream vs redhat versions of dependencies goes here -->
        <apiman.version>1.2.7.Beta1</apiman.version>
        <camel.version>2.17.1</camel.version>
        <fabric8.devops.version>2.2.303</fabric8.devops.version>
        <fabric8.version>2.2.192</fabric8.version>
        <fabric8.release.version>${fabric8.version}</fabric8.release.version>

        <maven.bundle.plugin.version>2.5.4</maven.bundle.plugin.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.javadoc.plugin.version>2.10.3</maven.javadoc.plugin.version>

        <arquillian.version>1.1.10.Final</arquillian.version>
        <commons.beanutils.version>1.9.2</commons.beanutils.version>
        <docker.assembly.exportBaseDir>false</docker.assembly.exportBaseDir>
        <docker.maven.plugin.version>0.17.1</docker.maven.plugin.version>
        <fabric8.dockerUser>fabric8/</fabric8.dockerUser>
        <fabric8.maven.plugin.version>3.2.13</fabric8.maven.plugin.version>
        <exec-maven-plugin.version>1.4.0</exec-maven-plugin.version>
        <junit.version>4.12</junit.version>
        <maven.require.version>3.1.1</maven.require.version>
        <maven.enforcer.plugin.version>1.4</maven.enforcer.plugin.version>

        <activemq.container.port>61616</activemq.container.port>
        <activemq.service.port>61616</activemq.service.port>

        <docker.from>docker.io/fabric8/java-jboss-openjdk8-jdk:1.0.10</docker.from>
        <docker.image>${fabric8.dockerUser}${project.artifactId}:${project.version}</docker.image>
        <docker.assemblyDescriptorRef>artifact-with-dependencies</docker.assemblyDescriptorRef>
        <docker.port.container.jolokia>8778</docker.port.container.jolokia>

        <!-- OSGi bundles properties -->
        <fuse.osgi.bundle.name>${project.name}</fuse.osgi.bundle.name>
        <fuse.osgi.import.fabric.version>
            version="[$(version;==;${fuse.osgi.version}),$(version;=+;${fuse.osgi.version}))"
        </fuse.osgi.import.fabric.version>
        <fuse.osgi.import.strict.version>
            version="[$(version;===;${fuse.osgi.version}),$(version;==+;${fuse.osgi.version}))"
        </fuse.osgi.import.strict.version>
        <fuse.osgi.import.default.version>[$(version;==;$(@)),$(version;+;$(@)))</fuse.osgi.import.default.version>
        <fuse.osgi.import.defaults>
            org.springframework.osgi.*;version="[1.2,2)",
            org.springframework.*;version="[3.2,5)",
            org.apache.commons.logging.*;version="[1.1,2)",
            org.apache.activemq.*;version="[5.11,6)",
            org.apache.camel.*;version="[2.17,3)",
        </fuse.osgi.import.defaults>
        <fuse.osgi.import.before.defaults/>
        <fuse.osgi.import.additional/>
        <fuse.osgi.import.pkg>
            io.fabric8.*;${fuse.osgi.import.fabric.version},
            ${fuse.osgi.import.before.defaults},
            ${fuse.osgi.import.defaults},
            ${fuse.osgi.import.additional},
            *
        </fuse.osgi.import.pkg>
        <fuse.osgi.activator/>
        <fuse.osgi.failok>false</fuse.osgi.failok>
        <fuse.osgi.private.pkg/>
        <fuse.osgi.export>io.fabric8.*;version=${fuse.osgi.version};-noimport:=true</fuse.osgi.export>
        <fuse.osgi.split.pkg>-split-package:=first</fuse.osgi.split.pkg>
        <fuse.osgi.import>${fuse.osgi.import.pkg}</fuse.osgi.import>
        <fuse.osgi.dynamic/>
        <fuse.osgi.symbolic.name>${project.groupId}.${project.artifactId}</fuse.osgi.symbolic.name>
        <fuse.osgi.exclude.dependencies>false</fuse.osgi.exclude.dependencies>
        <fuse.osgi.resource>{maven-resources}</fuse.osgi.resource>
        <fuse.osgi.embed.dependency>!*</fuse.osgi.embed.dependency>
        <fuse.osgi.embed.transitive>false</fuse.osgi.embed.transitive>
        <fuse.osgi.require.bundle/>
        <fuse.osgi.capabilities.provide/>
        <fuse.osgi.capabilities.require/>

    </properties>

    <modules>
        <module>apiman</module>
        <module>apiman-gateway</module>
        <module>camel-amq</module>
        <module>camel-master</module>
        <module>cassandra</module>
        <module>elasticsearch</module>
        <module>example-message-consumer</module>
        <module>example-message-producer</module>
        <module>fabric8-camel</module>
        <module>jnatsd</module>
        <module>kafka</module>
        <module>kafka-manager</module>
        <module>message-broker</module>
        <module>message-gateway</module>
        <module>mq-client</module>
        <module>zookeeper</module>
        <module>zookeeper-ensemble</module>
        <module>packages</module>
    </modules>

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

    <build>
      <pluginManagement>
        <plugins>
          <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>
          <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>${maven.bundle.plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <instructions>
                <Bundle-DocURL>http://fabric8.io/</Bundle-DocURL>
                <_include>-osgi.bnd</_include>
              </instructions>
            </configuration>
          </plugin>
        </plugins>
      </pluginManagement>
      <plugins>
        <!-- generate a .zip with all the quickstarts -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.7</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>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.18.1</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>
        <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>
      </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>io.fabric8</groupId>
                <artifactId>fabric8-cdi</artifactId>
                <version>${fabric8.version}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <!-- netty add until next release-->
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty</artifactId>
                <version>3.9.9.Final</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
          <id>fabric8-snapshot</id>
          <properties>
            <fabric8.version>2.2.102-SNAPSHOT</fabric8.version>
            <fabric8.release.version>2.2.40</fabric8.release.version>
          </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>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>
                    <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>
                </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>docker-build</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>io.fabric8</groupId>
                            <artifactId>docker-maven-plugin</artifactId>
                            <version>${docker.maven.plugin.version}</version>
                            <executions>
                                <execution>
                                    <goals>
                                        <goal>build</goal>
                                    </goals>
                                    <phase>package</phase>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </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>
