<!--

    Copyright 2014 SeaClouds
    Contact: SeaClouds

       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>
    <groupId>eu.seaclouds-project</groupId>
    <artifactId>platform</artifactId>
    <version>0.7.0-M19</version>
    <modules>
        <module>common</module>
        <!--module>monitor</module-->
        <module>deployer</module>
        <module>planner</module>
        <module>dashboard</module>
        <module>usage/installer</module>
    </modules>
    <packaging>pom</packaging>

    <name>SeaClouds Platform</name>
    <description>
        SeaClouds parent / project root,
        serving as the ancestor POM for all projects --
        declaring versions, profiles, and the modules to build
    </description>
    <url>http://www.seaclouds-project.eu</url>

    <developers>
        <developer>
            <name>Miguel Barrientos</name>
            <url>https://github.com/mbarrientos</url>
        </developer>
        <developer>
            <name>Jose Carrasco</name>
            <url>https://github.com/kiuby88</url>
        </developer>
        <developer>
            <name>Adrian Nieto</name>
            <url>https://github.com/adriannieto</url>
        </developer>
        <developer>
            <name>Mattia Buccarella</name>
            <url>https://github.com/buccarel</url>
        </developer>
        <developer>
            <name>Simone Zenzaro</name>
            <url>https://github.com/szenzaro</url>
        </developer>
        <developer>
            <name>Simone Zenzaro</name>
            <url>https://github.com/szenzaro</url>
        </developer>
        <developer>
            <name>Diego Perez</name>
            <url>https://github.com/perezp</url>
        </developer>
        <developer>
            <name>Michele Guerriero</name>
            <url>https://github.com/MicheleGuerriero</url>
        </developer>
        <developer>
            <name>Roman Sosa Gonzales</name>
            <url>https://github.com/rosogon</url>
        </developer>
        <developer>
            <name>Andrea Turli</name>
            <url>https://github.com/andreaturli</url>
        </developer>
    </developers>

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

        <includedTestGroups />
        <excludedTestGroups>Integration,Live</excludedTestGroups>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <guava.version>18.0</guava.version>
        <javatuples.version>1.2</javatuples.version>
        <brooklyn.version>0.7.0-20150614.2158</brooklyn.version>
        <jetty.version>9.2.4.v20141103</jetty.version>
        <dropwizard.version>0.8.1</dropwizard.version>
        <junit.version>4.11</junit.version>
        <testng.version>6.8.8</testng.version>
        <slf4j.version>1.7.12</slf4j.version>
        <snakeyaml.version>1.11</snakeyaml.version>
        <logback.version>1.0.7</logback.version>
    </properties>

    <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>
        <url>https://github.com/SeaCloudsEU/SeaCloudsPlatform/</url>
        <connection>scm:git:https://github.com/SeaCloudsEU/SeaCloudsPlatform.git</connection>
        <developerConnection>scm:git:git@github.com:SeaCloudsEU/SeaCloudsPlatform.git</developerConnection>
        <tag>0.7.0-M19</tag>
    </scm>

    <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>
            <name>Apache Snapshots</name>
            <url>https://repository.apache.org/content/repositories/snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <!-- TODO remove as soon as brooklyn officially release -->
        <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>
    </repositories>

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

    <dependencies>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
        </dependency>
        <dependency>
            <groupId>org.javatuples</groupId>
            <artifactId>javatuples</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>${snakeyaml.version}</version>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>
                    <configuration>
                        <enableAssertions>true</enableAssertions>
                        <groups>${includedTestGroups}</groups>
                        <excludedGroups>${excludedTestGroups}</excludedGroups>
                        <testFailureIgnore>false</testFailureIgnore>
                    </configuration>
                </plugin>
                <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>
                    <groupId>org.apache.rat</groupId>
                    <artifactId>apache-rat-plugin</artifactId>
                    <version>0.11</version>
                    <executions>
                        <execution>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <excludes combine.children="append">
                            <exclude>**/.git/**</exclude>
                            <exclude>**/.gitignore</exclude>
                            <exclude>**/.repository/**</exclude>
                            <exclude>**/.idea/**</exclude>
                            <exclude>**/*.iml</exclude>
                            <exclude>**/.classpath/**</exclude>
                            <exclude>**/.project</exclude>
                            <exclude>**/.settings/**</exclude>
                            <exclude>**/*.log</exclude>
                            <exclude>**/target/**</exclude>
                            <exclude>ignored/**</exclude>
                            <exclude>**/*.md</exclude>
                            <exclude>**/*.svg</exclude>
                            <exclude>**/MANIFEST.MF</exclude>
                            <exclude>**/test-output/**</exclude>
                            <exclude>**/*.pem.pub</exclude>
                            <exclude>**/*.svg</exclude>
                            <exclude>**/*.crt</exclude>
                            <exclude>**/*.csr</exclude>
                            <exclude>**/*.key</exclude>
                            <exclude>**/*.key.org</exclude>
                            <exclude>**/*.psd</exclude>
                            <exclude>**/*.json</exclude>
                            <exclude>**/*.yml</exclude>
                            <exclude>**/*.yaml</exclude>
                            <exclude>**/*.sh</exclude>
                            <exclude>**/Vagrantfile</exclude>
                            <exclude>**/seaclouds_id_rsa</exclude>
                            <exclude>**/seaclouds_id_rsa.pub</exclude>
                            <exclude>**/*.yml.template</exclude>
                        </excludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.13</version>
                <executions>
                    <execution>
                        <id>verify-style</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <logViolationsToConsole>true</logViolationsToConsole>
                    <checkstyleRules>
                        <module name="Checker">
                            <!-- Checks for whitespace                               -->
                            <!-- See http://checkstyle.sf.net/config_whitespace.html -->
                            <module name="FileTabCharacter">
                                <property name="eachLine" value="true" />
                            </module>
                            <module name="TreeWalker">
                                <module name="IllegalImport">
                                    <property name="illegalPkgs" value="com.google.api.client.repackaged" />
                                </module>
                            </module>
                        </module>
                    </checkstyleRules>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.3</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>sonatype-nexus-staging</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.2</version>
                <configuration>
                    <!--
                      During release:perform, enable the "release" profile
                     -->
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.3</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.brooklyn</groupId>
                <artifactId>brooklyn-rest-client</artifactId>
                <version>${brooklyn.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>org.javatuples</groupId>
                <artifactId>javatuples</artifactId>
                <version>${javatuples.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>

        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>Live</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>integration</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <configuration>
                                    <!-- note that the groups/excluded groups don't work due to some problem
                                         in surefire or testng. instead, we have to exclude via file path
                                         <groups>live,integration</groups>
                                         <excludedGroups>unit,performance</excludedGroups> -->
                                    <excludes>
                                        <exclude>none</exclude>
                                    </excludes>
                                    <includes>
                                        <include>**/*IntegrationTest.java</include>
                                        <include>**/*LiveTest.java</include>
                                    </includes>
                                    <systemPropertyVariables>
                                        <!--
                                            If you're behind a proxy, set this here
                                            http://java.sun.com/javase/6/docs/technotes/guides/net/proxies.html

                    <https.proxyHost>proxy</https.proxyHost>
                    <https.proxyPort>port</https.proxyPort>
                    <https.noProxyHosts>localhost|10.150.4.49</https.noProxyHosts>
                                        -->
                                        <file.encoding>${project.build.sourceEncoding}</file.encoding>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>doclint-java8-disable</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
