<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2014-2015 by Cloudsoft Corporation Limited

    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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <modules>
        <module>patches</module>
        <module>docker</module>
        <module>console</module>
        <module>examples</module>
    </modules>

    <parent>
        <groupId>org.apache.brooklyn</groupId>
        <artifactId>brooklyn-downstream-parent</artifactId>
        <version>0.7.0-SNAPSHOT</version> <!-- BROOKLYN_VERSION -->
    </parent>

    <groupId>io.brooklyn.clocker</groupId>
    <artifactId>brooklyn-clocker-parent</artifactId>
    <version>0.8.2</version>  <!-- CLOCKER_VERSION -->
    <packaging>pom</packaging>
    <name>Clocker Project (Parent)</name>
    <description>
        Clocker parent. Brooklyn deployment and management of Docker containers as a cloud infrastructure.
    </description>

    <properties>
        <!-- Compilation -->
        <java.version>1.6</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Dependencies -->
        <jclouds.groupId>org.apache.jclouds</jclouds.groupId>
        <jclouds.version>1.9.0</jclouds.version>

        <!-- Testing -->
        <testng.version>6.8</testng.version>
        <brooklyn.version>0.7.0-SNAPSHOT</brooklyn.version> <!-- BROOKLYN_VERSION -->
        <includedTestGroups/>
        <excludedTestGroups>Integration,Live,WIP</excludedTestGroups>

        <!-- Deployment -->
        <gpg.passphrase />
    </properties>

    <scm>
        <url>https://github.com/brooklyncentral/clocker</url>
        <connection>scm:git:https://github.com/brooklyncentral/clocker.git</connection>
        <developerConnection>scm:git:git@github.com:brooklyncentral/clocker.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/brooklyncentral/clocker/issues</url>
    </issueManagement>

    <licenses>
        <license>
            <name>Apache 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <repositories>
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>apache-snapshots</id>
            <url>https://repository.apache.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <!-- Cloudsoft repo, for early custom releases of jclouds-docker -->
        <repository>
            <id>cloudsoft</id>
            <url>http://ccweb.cloudsoftcorp.com/maven/libs-release-local/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <build>
        <testSourceDirectory>src/test/java</testSourceDirectory>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>

        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.5.4</version>
                    <configuration>
                        <tarLongFileMode>gnu</tarLongFileMode>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.6.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-eclipse-plugin</artifactId>
                    <version>2.10</version>
                </plugin>
                <plugin>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.4</version>
                </plugin>
                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.18.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.6</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.3</version>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.5.4</version>
                    <extensions>true</extensions>
                    <executions>
                        <execution>
                            <id>bundle-manifest</id>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>manifest</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <supportedProjectTypes>
                            <supportedProjectType>jar</supportedProjectType>
                        </supportedProjectTypes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>.</directory>
                            <includes>
                                <include>brooklyn*.log</include>
                                <include>brooklyn*.log.*</include>
                                <include>stacktrace.log</include>
                                <include>test-output</include>
                                <include>prodDb.*</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <configuration>
                    <additionalProjectnatures>
                        <projectnature>org.maven.ide.eclipse.maven2Nature</projectnature>
                    </additionalProjectnatures>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <useReleaseProfile>true</useReleaseProfile>
                    <releaseProfiles>Release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <properties>
                        <property>
                            <name>listener</name>
                            <value>brooklyn.test.LoggingVerboseReporter</value>
                        </property>
                    </properties>
                    <enableAssertions>true</enableAssertions>
                    <groups>${includedTestGroups}</groups>
                    <excludedGroups>${excludedTestGroups}</excludedGroups>
                    <testFailureIgnore>false</testFailureIgnore>
                    <systemPropertyVariables>
                        <verbose>-1</verbose>
                    </systemPropertyVariables>
                    <printSummary>true</printSummary>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.3</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                    <shortRevisionLength>7</shortRevisionLength>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>Release</id>
            <activation>
                <property>
                    <name>brooklyn.deployTo</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <inherited>true</inherited>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <inherited>true</inherited>
                        <configuration>
                            <use>false</use>
                            <links>
                                <link>http://download.oracle.com/javaee/6/api</link>
                            </links>
                            <keywords>true</keywords>
                            <author>false</author>
                            <quiet>true</quiet>
                            <aggregate>false</aggregate>
                            <detectLinks />
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>Integration</id>
            <properties>
                <includedTestGroups>Integration</includedTestGroups>
                <excludedTestGroups>Live,WIP</excludedTestGroups>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <inherited>true</inherited>
                        <executions>
                            <execution>
                                <id>run-tests</id>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <phase>integration-test</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>Live</id>
            <properties>
                <includedTestGroups>Live</includedTestGroups>
                <excludedTestGroups>Integration,WIP</excludedTestGroups>
            </properties>
        </profile>
        <profile>
            <id>WIP</id>
            <properties>
                <includedTestGroups>WIP</includedTestGroups>
                <excludedTestGroups>Integration,Live</excludedTestGroups>
            </properties>
        </profile>
        <profile>
          <id>cloudsoft-release</id>
          <activation>
            <property>
              <name>brooklyn.deployTo</name>
              <value>cloudsoft</value>
            </property>
          </activation>
          <distributionManagement>
            <repository>
              <id>cloudsoft-deploy-artifactory-release</id>
              <name>Cloudsoft Artifactory libs-release-local repo</name>
              <url>http://ccweb.cloudsoftcorp.com/maven/libs-release-local/</url>
            </repository>
            <snapshotRepository>
              <id>cloudsoft-deploy-artifactory-snapshot</id>
              <name>Cloudsoft Artifactory libs-snapshot-local repo</name>
              <url>http://ccweb.cloudsoftcorp.com/maven/libs-snapshot-local/</url>
            </snapshotRepository>
          </distributionManagement>
        </profile>
    </profiles>
</project>
