<?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">
  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>4</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.apache.zookeeper</groupId>
  <artifactId>zookeeper-pom</artifactId>
  <version>3.0.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  
  <name>ZooKeeper</name>
  <description>
    ZooKeeper is a service for coordinating processes of distributed applications. Historically distributed processes are coordinated 
    using group messaging, shared registers, or distributed lock services. ZooKeeper incorporates elements from all these servers, 
    but incorporates them into a replicated centralized service. The interface exposed by ZooKeeper incorporates the wait-free aspects 
    of group messaging and shared registers with an eventing mechanism similar to those of locking services to provide a simple,
    yet powerful coordination service. 
  </description>
  
  <properties>
    <junit-version>4.4</junit-version>
    <log4j-version>1.2.15</log4j-version>
  </properties>

  <prerequisites>
    <maven>2.0.8</maven>
  </prerequisites>

  <!-- TODO: need to update this once the ZooKeeper site is on Apache Servers -->
  <url>http://hadoop.apache.org/zookeeper</url>

  <mailingLists>
    <mailingList>
      <name>Development List</name>
      <subscribe>zookeeper-dev-subscribe@hadoop.apache.org</subscribe>
      <unsubscribe>zookeeper-dev-unsubscribe@hadoop.apache.org</unsubscribe>
      <post>zookeeper-dev@hadoop.apache.org</post>
    </mailingList>
    <mailingList>
      <name>User List</name>
      <subscribe>zookeeper-user-subscribe@hadoop.apache.org</subscribe>
      <unsubscribe>zookeeper-user-unsubscribe@hadoop.apache.org</unsubscribe>
      <post>zookeeper-user@hadoop.apache.org</post>
    </mailingList>
  </mailingLists>
  
  <modules>
    <module>zookeeper-jute</module>
    <module>zookeeper-jute-compiler</module>
    <module>zookeeper-core</module>
    <module>zookeeper-jmx</module>
    <module>zookeeper-protocols</module>
    <module>zookeeper-all</module>
    <module>zookeeper-c</module>
  </modules>

  <scm>
    <connection>scm:svn:http://svn.apache.org/repos/asf/hadoop/zookeeper/trunk</connection>
    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/hadoop/zookeeper/trunk</developerConnection>
    <url>http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/</url>
  </scm>

  <dependencyManagement>
    <dependencies>
      
      <dependency>
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper-jute</artifactId>
        <version>3.0.0-SNAPSHOT</version>
      </dependency>

      <dependency>
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper-jute-compiler</artifactId>
        <version>3.0.0-SNAPSHOT</version>
      </dependency>

      <dependency>
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper-core</artifactId>
        <version>3.0.0-SNAPSHOT</version>
      </dependency>
      
      <dependency>
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper-jmx</artifactId>
        <version>3.0.0-SNAPSHOT</version>
      </dependency>

      <dependency>
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper-all</artifactId>
        <version>3.0.0-SNAPSHOT</version>
      </dependency>
      
      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j-version}</version>
        <exclusions>
          <exclusion>
            <groupId>com.sun.jmx</groupId>
            <artifactId>jmxri</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.sun.jdmk</groupId>
            <artifactId>jmxtools</artifactId>
          </exclusion>
          <exclusion>
            <groupId>javax.jms</groupId>
            <artifactId>jms</artifactId>
          </exclusion>
          <exclusion>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit-version}</version>
        <scope>test</scope>
      </dependency>
      
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.2-beta-2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.0.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-eclipse-plugin</artifactId>
          <version>2.4</version>
          <configuration>
            <downloadSources>true</downloadSources>
            <downloadJavadocs>true</downloadJavadocs>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.0-alpha-4</version>
          <executions>
            <execution>
              <goals>
                <goal>sign</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.0-beta-7</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-remote-resources-plugin</artifactId>
          <version>1.0</version>
          <executions>
            <execution>
              <goals>
                <goal>process</goal>
              </goals>
              <configuration>
                <properties>
                  <projectName>${projectName}</projectName>
                </properties>
                <resourceBundles>
                  <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
                </resourceBundles>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.0.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-stage-plugin</artifactId>
          <version>1.0-alpha-1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.geronimo.genesis.plugins</groupId>
          <artifactId>tools-maven-plugin</artifactId>
          <version>1.4</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>rat-maven-plugin</artifactId>
          <version>1.0-alpha-3</version>
          <configuration>
            <excludeSubProjects>false</excludeSubProjects>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <forkMode>once</forkMode>
            <argLine>-Xmx400M</argLine>
            <failIfNoTests>false</failIfNoTests>
            <forkMode>pertest</forkMode>
            <useFile>true</useFile>
            <systemProperties>
              <property>
                <name>build.test.dir</name>
                <value>${project.build.directory}</value>
              </property>
            </systemProperties>
            <includes>
              <include>**/*Test.*</include>
            </includes>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <index>true</index>
            <compress>true</compress>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
          <outputDirectory>${basedir}/eclipse-classes</outputDirectory>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>rat-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.geronimo.genesis.plugins</groupId>
        <artifactId>tools-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>verify-legal-files</id>
            <phase>verify</phase>
            <goals>
              <goal>verify-legal-files</goal>
            </goals>
            <configuration>
              <!-- Fail the build if no legal files were found -->
              <strict>true</strict>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-remote-resources-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-stage-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
      </plugin>
      
    </plugins>
  </build>
  
  <reporting>
    <plugins>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>taglist-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <links>
            <link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
            <link>http://java.sun.com/j2ee/1.5/docs/api/</link>
            <link>http://junit.sourceforge.net/javadoc/</link>
            <link>http://logging.apache.org/log4j/docs/api/</link>
          </links>
          <linksource>true</linksource>
          <maxmemory>900m</maxmemory>
          <source>1.5</source>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

  <profiles>

    <profile>
      <id>release</id>

      <build>
        <plugins>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <test>false</test>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <configuration>
              <useReleaseProfile>false</useReleaseProfile>
              <goals>deploy</goals>
              <arguments>-Prelease</arguments>
              <autoVersionSubmodules>true</autoVersionSubmodules>
            </configuration>
          </plugin>

          <!-- We want a source jar -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- We want to sign the artifact, the POM, and all attached artifacts -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <inherited>true</inherited>
            <configuration>
              <passphrase>${gpg.passphrase}</passphrase>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- We want to deploy the artifact to a staging location for perusal -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <inherited>true</inherited>
            <configuration>
                <altDeploymentRepository>${staging.altRepository}/${siteId}</altDeploymentRepository>
              <updateReleaseInfo>true</updateReleaseInfo>
            </configuration>
          </plugin>

          <!-- We want the JavaDoc JAR published with the release -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <inherited>true</inherited>
            <configuration>
              <source>1.5</source>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>full</id>

      <build>
        <plugins>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <test>false</test>
            </configuration>
          </plugin>

          <!-- We want a source jar -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- We want the JavaDoc JAR published with the release -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <inherited>true</inherited>
            <configuration>
              <source>1.5</source>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>

</project>
