<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>io.brooklyn.etcd</groupId>
    <artifactId>brooklyn-etcd</artifactId>
    <version>2.2.0</version> <!-- BROOKLYN_ETCD_VERSION -->
    <packaging>jar</packaging>
    <name>Brooklyn Etcd Entities</name>
    <description>
        Brooklyn entities for a CoreOS etcd key-value store cluster.
    </description>

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

    <properties>
      <jax-rs-api.version>2.0.1</jax-rs-api.version>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>org.apache.brooklyn</groupId>
            <artifactId>brooklyn-software-nosql</artifactId>
            <version>${brooklyn.version}</version><!--$NO-MVN-MAN-VER$-->
        </dependency>

        <!-- for etcd testing -->
        <!-- TODO -->

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${testng.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.brooklyn</groupId>
            <artifactId>brooklyn-test-support</artifactId>
            <version>${brooklyn.version}</version><!--$NO-MVN-MAN-VER$-->
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.brooklyn</groupId>
            <artifactId>brooklyn-core</artifactId>
            <version>${brooklyn.version}</version><!--$NO-MVN-MAN-VER$-->
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.brooklyn</groupId>
            <artifactId>brooklyn-software-nosql</artifactId>
            <version>${brooklyn.version}</version><!--$NO-MVN-MAN-VER$-->
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <!-- bring in jclouds for testing -->
        <dependency>
            <groupId>org.apache.brooklyn</groupId>
            <artifactId>brooklyn-locations-jclouds</artifactId>
            <version>${brooklyn.version}</version><!--$NO-MVN-MAN-VER$-->
            <scope>test</scope>
        </dependency>
        <dependency>
            <!-- We exclude jsr311-api transitive dependency from jclouds (for javax.ws.rs) due to version conflict.
                 Therefore explicitly bring this one in.
            -->
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>${jax-rs-api.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
      <pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.apache.rat</groupId>
            <artifactId>apache-rat-plugin</artifactId>
            <configuration>
              <excludes combine.children="append">
                <!--
                    Configuration artifacts (for installations) are based on templated defaults for 
                    the given components. These are files "without any degree of creativity" from the
                    perspective of the Brooklyn/Apache contribution.
                -->
                <!-- TODO
                <exclude>src/main/resources/org/apache/brooklyn/entity/nosql/etcd/*</exclude>
                -->
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </pluginManagement>
    </build>

  <profiles>
    <!--
      Make release build (e.g. for Sonatype) with -PRelease
      Note that a sonatype release requires signed artifacts, javadoc and source jars; 
      this snippet doesn't do everything, as you need to set up a key etc,
      but it should get you a long way there (and prevent maven faffing).
      If you don't deploy you can delete or ignore this (it has no effect unless you 
      enter -PRelease).
    -->
    <profile>
      <id>Release</id>
      <activation>
        <property>
          <name>performRelease</name>
        </property>
      </activation>
      <properties>
        <gpg.passphrase />
      </properties>
      <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>
              <!-- disable 'use' reporting because of NPE deploying to sonatype: 
                   http://stackoverflow.com/questions/888199/why-does-maven-install-fail-during-javadoc-generation 
                   http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=ac084ab7f47c4e7f1df2117cecd?bug_id=5101868 -->
              <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 />
              <tags>
                <tag>
                  <name>todo</name>
                  <placement>a</placement>
                  <head>To-do:</head>
                </tag>
              </tags>
            </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>sonatype-nexus-repo</id>
      <activation> <property><name>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>
