<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2014 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>

    <groupId>io.brooklyn.networking</groupId>
    <artifactId>brooklyn-networking-parent</artifactId>
    <packaging>pom</packaging>
    <version>0.9.0</version>  <!-- ADVANCED_NETWORKING_VERSION -->

    <name>Brooklyn Advanced Networking</name>
    <description>
        Advanced networking support for various clouds.
    </description>

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

    <properties>
        <brooklyn.version>0.9.0</brooklyn.version> <!-- BROOKLYN_VERSION -->
        <vcloud-director.version>1.9.2</vcloud-director.version>
        <jclouds.groupId>org.apache.jclouds</jclouds.groupId> <!-- JCLOUDS_GROUPID_VERSION -->
    </properties>

    <scm>
        <connection>scm:git:git://github.com/brooklyncentral/advanced-networking.git</connection>
        <developerConnection>scm:git:git@github.com:brooklyncentral/advanced-networking.git</developerConnection>
        <url>https://github.com/brooklyncentral/advanced-networking</url>
    </scm>

    <repositories>
        <repository>
            <id>sonatype-oss-releases</id>
            <url>https://oss.sonatype.org/content/repositories/releases/</url>
        </repository>
        <repository>
            <id>sonatype-oss-snapshots</id>
            <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 custom releases of jclouds vcloud-director etc -->
        <repository>
            <id>cloudsoft-releases</id>
            <url>https://artifactory.cloudsoftcorp.com/artifactory/libs-release-local/</url>
        </repository>
        <repository>
            <id>cloudsoft-snapshots</id>
            <url>https://artifactory.cloudsoftcorp.com/artifactory/libs-snapshot-local/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </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>
    
    <modules>
        <module>common</module>
        <module>portforwarding</module>
        <module>cloudstack</module>
        <module>vcloud-director</module>
        <module>vcloud-director-portforwarding</module>
    </modules>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.3.7</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>
                    <instructions>
                        <!-- OSGi specific instruction -->
                        <Import-Package>!com.maxmind.geoip2,*</Import-Package>
                    </instructions>
                </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>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>

        <profile>
            <id>sonatype-release</id>
            <activation>
                <property><name>brooklyn.deployTo</name><value>sonatype</value></property>
            </activation>
            <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>
        </profile>

    </profiles>
</project>
