<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>7</version>
  </parent>

  <groupId>org.apache.whirr</groupId>
  <artifactId>whirr</artifactId>
  <version>0.9.0-SNAPSHOT</version>
  <packaging>pom</packaging>

  <name>Whirr</name>
  <description>Libraries for running cloud services</description>
  <url>http://whirr.apache.org/</url>
  <inceptionYear>2010</inceptionYear>

  <modules>
    <module>build-tools</module>
    <module>cli</module>
    <module>core</module>
    <module>examples</module>
    <module>services/cassandra</module>
    <module>services/cdh</module>
    <module>services/cdh-oldtests</module>
    <module>services/ganglia</module>
    <module>services/hadoop</module>
    <module>services/yarn</module>
    <module>services/zookeeper</module>
    <module>services/hbase</module>
    <module>services/elasticsearch</module>
    <module>services/hama</module>
    <module>services/puppet</module>
    <module>services/chef</module>
    <module>services/mahout</module>
    <module>services/pig</module>
    <module>services/solr</module>
  </modules>

  <properties>
    <commons.codec.version>1.6</commons.codec.version>
    <commons.configuration.version>1.7</commons.configuration.version>
    <commons.compress.version>1.4</commons.compress.version>
    <commons.httpclient.version>3.1</commons.httpclient.version>
    <commons.io.version>1.4</commons.io.version>
    <common-ssl.version>0.3.11</common-ssl.version>
    <dnsjava.version>2.1.1</dnsjava.version>
    <guava.version>13.0</guava.version>
    <hadoop.version>0.20.205.0</hadoop.version>
    <hamcrest.version>1.1</hamcrest.version>
    <hama.version>0.4.0-incubating</hama.version>
    <hbase.version>0.92.0</hbase.version>
    <jackson.version>1.5.2</jackson.version>
    <jclouds.version>1.5.0-beta.11</jclouds.version>
    <jdom.version>1.1</jdom.version>
    <jopt.simple.version>4.3</jopt.simple.version>
    <jsch.version>0.1.48</jsch.version>
    <junit.version>4.8.1</junit.version>
    <log4j.version>1.2.16</log4j.version>
    <mockito.version>1.9.0</mockito.version>
    <not.yet.commons.ssl.version>0.3.11</not.yet.commons.ssl.version>
    <osgi.version>4.2.0</osgi.version>
    <protobuff.version>2.3.0</protobuff.version>
    <slf4j.version>1.6.4</slf4j.version>
    <voldermort.version>0.90</voldermort.version>
    <zookeeper.version>3.3.1</zookeeper.version>
    <velocity.version>1.7</velocity.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${guava.version}</version>
      </dependency>
      <dependency>
        <groupId>ca.juliusdavies</groupId>
        <artifactId>not-yet-commons-ssl</artifactId>
        <version>${common-ssl.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jclouds</groupId>
        <artifactId>jclouds-core</artifactId>
        <version>${jclouds.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jclouds</groupId>
        <artifactId>jclouds-compute</artifactId>
        <version>${jclouds.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jclouds.api</groupId>
        <artifactId>byon</artifactId>
        <version>${jclouds.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jclouds.driver</groupId>
        <artifactId>jclouds-sshj</artifactId>
        <version>${jclouds.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jclouds.driver</groupId>
        <artifactId>jclouds-slf4j</artifactId>
        <version>${jclouds.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jclouds.driver</groupId>
        <artifactId>jclouds-enterprise</artifactId>
        <version>${jclouds.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jclouds</groupId>
        <artifactId>jclouds-allcompute</artifactId>
        <version>${jclouds.version}</version>
      </dependency>
      <dependency>
        <groupId>org.jclouds</groupId>
        <artifactId>jclouds-allblobstore</artifactId>
        <version>${jclouds.version}</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>${jackson.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>${jackson.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>${hamcrest.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>${commons.httpclient.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-configuration</groupId>
        <artifactId>commons-configuration</artifactId>
        <version>${commons.configuration.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-compress</artifactId>
        <version>${commons.compress.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${commons.io.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>${commons.codec.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons.compress.version</artifactId>
        <version>${commons.compress.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
        <exclusions>
          <exclusion>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
          </exclusion>
          <exclusion>
            <groupId>javax.jms</groupId>
            <artifactId>jms</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.sun.jdmk</groupId>
            <artifactId>jmxtools</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.sun.jmx</groupId>
            <artifactId>jmxri</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.jcraft</groupId>
        <artifactId>jsch</artifactId>
        <version>${jsch.version}</version>
      </dependency>
      <dependency>
        <groupId>dnsjava</groupId>
        <artifactId>dnsjava</artifactId>
        <version>${dnsjava.version}</version>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.core</artifactId>
        <version>${osgi.version}</version>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.compendium</artifactId>
        <version>${osgi.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ssh-external</artifactId>
        <version>2.2</version>
      </extension>
    </extensions>
    <plugins>
      <!-- Plugins in alphabetical order: by group then artifact -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <appendAssemblyId>false</appendAssemblyId>
          <tarLongFileMode>gnu</tarLongFileMode>
          <descriptors>
            <descriptor>build-tools/src/assemble-bin.xml</descriptor>
          </descriptors>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.8</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.whirr</groupId>
            <artifactId>whirr-build-tools</artifactId>
            <version>${project.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>checkstyle</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <configLocation>checkstyle.xml</configLocation>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <failsOnError>true</failsOnError>
          <!-- HBaseServiceController fails checkstyle since Thrift TException cannot be found.
               Probably a classpath issue, so until that is fixed, we exclude the class. -->
          <excludes>
            **/org/apache/whirr/service/hbase/integration/HBaseServiceController.java
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.0.1</version>
        <executions>
          <execution>
            <id>enforce-java</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.0.2,)</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true
              </addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true
              </addDefaultSpecificationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-remote-resources-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
          <execution>
            <goals>
              <goal>process</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <resourceBundles>
            <resourceBundle>org.apache:apache-jar-resource-bundle:1.4
            </resourceBundle>
          </resourceBundles>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.2</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.11</version>
        <configuration>
          <excludes>
            <exclude>**/integration/*Test.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      <!-- mvn apache-rat:check - runs RAT check on the source -->
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.8</version>
        <inherited>false</inherited>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <excludes>
            <exclude>**/BUILD.txt</exclude>
            <exclude>**/CHANGES.txt</exclude>
            <exclude>**/NOTICE-src.txt</exclude>
            <exclude>.git/**</exclude>
            <exclude>.gitignore</exclude>
            <exclude>**/*.json</exclude>
            <exclude>**/src/test/resources/*.txt</exclude>
            <exclude>**/src/main/resources/version-banner.txt</exclude>
            <exclude>docs/**</exclude>
            <exclude>**/*.log*</exclude>
            <exclude>.idea/**</exclude>
            <exclude>**/*.iml</exclude>
            <exclude>**/.project</exclude>
            <exclude>**/.classpath</exclude>
            <exclude>**/.settings/**</exclude>
            <exclude>**/.checkstyle</exclude>
            <exclude>**/target/**</exclude>
            <exclude>src/site/resources/images/whirr-logo.ai</exclude>
            <!-- binary -->
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.3.6</version>
        <extensions>true</extensions>
        <inherited>true</inherited>
        <configuration>
          <instructions>
            <Bundle-Name>${project.name}</Bundle-Name>
            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
            <Bundle-Activator>${osgi.bundle.activator}</Bundle-Activator>
            <Export-Package>${osgi.export}</Export-Package>
            <Import-Package>${osgi.import}</Import-Package>
            <DynamicImport-Package>${osgi.dynamic.import}
            </DynamicImport-Package>
            <Private-Package>${osgi.private}</Private-Package>
            <Require-Bundle>${osgi.bundles}</Require-Bundle>
            <Export-Service>${osgi.export.service}</Export-Service>
            <Fragment-Host>${osgi.fragment.host}</Fragment-Host>
            <SPI-Provider>${osgi.spi.provider}</SPI-Provider>
            <SPI-Consumer>${osgi.spi.consumer}</SPI-Consumer>
          </instructions>
          <supportedProjectTypes>
            <supportedProjectType>jar</supportedProjectType>
            <supportedProjectType>war</supportedProjectType>
            <supportedProjectType>bundle</supportedProjectType>
          </supportedProjectTypes>
          <unpackBundle>true</unpackBundle>
        </configuration>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.0</version>
          <inherited>false</inherited>
          <configuration>
            <templateDirectory>${basedir}/src/site/resources</templateDirectory>
            <template>site.vm</template>
            <relativizeDecorationLinks>false</relativizeDecorationLinks>
            <reportPlugins>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.8.1</version>
                <configuration>
                  <encoding>${project.build.sourceEncoding}</encoding>
                  <quiet>true</quiet>
                  <maxmemory>256m</maxmemory>
                </configuration>
                <reportSets>
                  <reportSet>
                    <id>default</id>
                    <reports>
                      <report>javadoc</report>
                      <report>aggregate</report>
                    </reports>
                  </reportSet>
                </reportSets>
              </plugin>
            </reportPlugins>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <repositories>
    <repository>
      <id>apache.snapshots</id>
      <name>Apache Snapshot Repository</name>
      <url>http://repository.apache.org/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
    <repository>
      <id>central</id>
      <url>http://repo1.maven.org/maven2/</url>
    </repository>
    <repository>
      <id>cloudera</id>
      <url>https://repository.cloudera.com/content/repositories/releases/</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>apache-snapshots</id>
      <url>https://repository.apache.org/content/repositories/snapshots</url>
    </pluginRepository>
  </pluginRepositories>
  <distributionManagement>
    <repository>
      <id>apache.staging.https</id>
      <name>Nexus Staging Repo</name>
      <url>https://repository.apache.org/service/local/staging/deploy/maven2/
      </url>
    </repository>
    <site>
      <id>apache.website</id>
      <url>
        scpexe://people.apache.org/www/whirr.apache.org/docs/${project.version}
      </url>
    </site>
  </distributionManagement>
  <profiles>
    <profile>
      <!-- Used only when cutting a full release.  Configures the deploy plugin to mark
          each artifact as a release (especially important for the archetype). Signs each
          file deployed (it actually signs way too many files and we have to clean up a bit
          once deployed). -->
      <id>deploy</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.4</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <properties>
        <update-release-info>true</update-release-info>
        <!--  Don't re-run tests as part of the deploy build.
              Note we use skipTests, not maven.test.skip, since the latter skips
              compilation too and we want to deploy tests. -->
        <skipTests>true</skipTests>
      </properties>
    </profile>
    <profile>
      <!--  Only bind Javadoc JARs when the javadoc profile is active, since it is slow. -->
      <id>javadoc</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.8</version>
            <configuration>
              <excludePackageNames>org.jclouds.*</excludePackageNames>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <!--  Run integration tests against real cloud providers. -->
      <id>integration</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.11</version>
            <configuration>
              <includes>
                <include>**/integration/*Test.java</include>
              </includes>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>integration-test</goal>
                </goals>
              </execution>
              <execution>
                <id>verify</id>
                <goals>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <!-- Build the source distribution. This is written as a profile
      since it doesn't work in child modules. -->
      <id>package</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.3</version>
            <configuration>
              <descriptors>
                <descriptor>build-tools/src/assemble-src.xml</descriptor>
              </descriptors>
            </configuration>
            <executions>
              <execution>
                <id>dist-assembly</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <appendAssemblyId>true</appendAssemblyId>
                  <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
                  <tarLongFileMode>gnu</tarLongFileMode>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <!-- Activate this profile to build the Voldemort service after manually
      placing the Voldemort JAR in services/voldemort/lib.
      See https://issues.apache.org/jira/browse/WHIRR-442
       -->
      <id>voldemort</id>
      <modules>
        <module>services/voldemort</module>
      </modules>
    </profile>
    <profile>
      <!-- Activate this profile to build & test OSGi support -->
      <id>osgi</id>
      <modules>
        <module>platforms/karaf</module>
      </modules>
      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.apache.whirr.karaf</groupId>
            <artifactId>apache-whirr</artifactId>
            <version>${project.version}</version>
            <type>xml</type>
            <classifier>features</classifier>
            <scope>test</scope>
          </dependency>
        </dependencies>
      </dependencyManagement>
    </profile>
  </profiles>
</project>
