<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>

  <groupId>org.rhq</groupId>
  <artifactId>rhq-parent</artifactId>
  <version>1.2.0.GA</version>
  <packaging>pom</packaging>

  <name>RHQ</name>
  <description>parent POM for all RHQ modules</description>
  <url>http://rhq-project.org/</url>
  <inceptionYear>2008</inceptionYear>

  <organization>
    <name>RHQ Project Advisory Board (Hyperic &amp; Red Hat, Inc.)</name>
    <url>http://rhq-project.org/</url>
  </organization>

  <scm>
    <connection>scm:svn:http://svn.rhq-project.org/repos/rhq/tags/RHQ_1_2_0_GA</connection>
    <developerConnection>scm:svn:http://svn.rhq-project.org/repos/rhq/tags/RHQ_1_2_0_GA</developerConnection>
  </scm>

  <issueManagement>
    <system>jira</system>
    <url>http://jira.rhq-project.org/</url>
  </issueManagement>

  <properties>
    <rhq.groupId>org.rhq</rhq.groupId>
    <rhq.product.name>RHQ</rhq.product.name>
    <rhq.earName>rhq.ear</rhq.earName>
    <!-- the below path is relative to {rhq-trunk} -->
    <rhq.defaultDevContainerPath>dev-container</rhq.defaultDevContainerPath>
    <!-- set the below prop to true to enable misc extra build output -->
    <rhq.debug>false</rhq.debug>

    <scm.branch>trunk</scm.branch>
    <scm.module.path />

    <doUpdate>false</doUpdate>

    <java5.home>${java.home}</java5.home>

    <!-- dependency versions -->
    <commons-logging.version>1.1.0.jboss</commons-logging.version>
    <concurrent.version>1.3.4-jboss</concurrent.version>
    <getopt.version>1.0.13</getopt.version>
    <jaxb-api.version>2.1</jaxb-api.version>
    <jaxb-impl.version>2.1.6</jaxb-impl.version>
    <jboss.version>4.2.1.GA</jboss.version>
    <jboss-common.version>1.2.0.GA</jboss-common.version>
    <jboss-remoting.version>2.2.1.GA</jboss-remoting.version> <!-- version that ships w/ AS 4.2.1.GA -->
    <jboss-serialization.version>1.0.3.GA</jboss-serialization.version> <!-- version that ships w/ AS 4.2.1.GA -->
    <jsf-api.version>1.2_12</jsf-api.version>
    <jsf-impl.version>1.2_12</jsf-impl.version>
    <ojdbc14.version>10.2.0.4.0</ojdbc14.version>
    <ojdbc5.version>11.1.0.7.0</ojdbc5.version>
    <ems.version>1.2.6</ems.version>
    <postgresql.version>8.3-604.jdbc3</postgresql.version>
    <richfaces.version>3.3.0.GA</richfaces.version>
    <sigar.version>1.6.0.14</sigar.version>

    <!-- misc properties -->
    <server.quartzDelegate>org.quartz.impl.jdbcjobstore.PostgreSQLDelegate</server.quartzDelegate>

    <!-- defaults for datasource used by dbsetup, unit+integration tests, and dev container build -
         these may be overridden in ~/.m2/settings.xml -->
    <rhq.test.ds.connection-url>jdbc:postgresql://127.0.0.1:5432/rhq</rhq.test.ds.connection-url>
    <rhq.test.ds.driver-class>org.postgresql.Driver</rhq.test.ds.driver-class>
    <rhq.test.ds.xa-datasource-class>org.postgresql.xa.PGXADataSource</rhq.test.ds.xa-datasource-class>
    <rhq.test.ds.user-name>rhqadmin</rhq.test.ds.user-name>
    <rhq.test.ds.password>rhqadmin</rhq.test.ds.password>
    <rhq.test.ds.type-mapping>PostgreSQL</rhq.test.ds.type-mapping>
    <rhq.test.ds.server-name>127.0.0.1</rhq.test.ds.server-name>
    <rhq.test.ds.port>5432</rhq.test.ds.port>
    <rhq.test.ds.db-name>rhq</rhq.test.ds.db-name>
    <rhq.test.ds.hibernate-dialect>org.hibernate.dialect.PostgreSQLDialect</rhq.test.ds.hibernate-dialect>

     <!-- default port numbers for RHQ server -->
    <rhq.server.http.port>7080</rhq.server.http.port>
    <rhq.server.https.port>7443</rhq.server.https.port>

    <rhq.server.enable.ws>false</rhq.server.enable.ws>

    <!-- NOTE: The below line is a workaround for a Maven bug, where it does not expand settings.* properties
               used in the distributionManagement section of the POM. -->
    <localRepository>${user.home}/.m2/repository</localRepository>
  </properties>

  <dependencyManagement>

    <dependencies>

      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.0.jboss</version>
      </dependency>

      <!-- GNU GetOpt (any modules that need to do command-line argument parsing should use this) -->
      <dependency>
        <groupId>gnu-getopt</groupId>
        <artifactId>getopt</artifactId>
        <version>1.0.13</version>
      </dependency>

      <dependency>
         <groupId>javax.xml.bind</groupId>
         <artifactId>jaxb-api</artifactId>
         <version>2.1</version>
      </dependency>

      <dependency>
         <groupId>javax.faces</groupId>
         <artifactId>jsf-api</artifactId>
         <version>1.2_12</version>
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <dependency>
         <groupId>javax.faces</groupId>
         <artifactId>jsf-impl</artifactId>
         <version>1.2_12</version>
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <dependency>
         <groupId>com.sun.xml.bind</groupId>
         <artifactId>jaxb-impl</artifactId>
         <version>2.1.6</version>
      </dependency>

      <dependency>
        <groupId>jboss</groupId>
        <artifactId>jboss-common</artifactId>
        <version>1.2.0.GA</version>
      </dependency>

      <dependency>
        <groupId>jboss</groupId>
        <artifactId>jboss-jmx</artifactId>
        <version>4.2.1.GA</version>
      </dependency>

      <dependency>
        <groupId>jboss</groupId>
        <artifactId>jboss-remoting</artifactId>
        <version>2.2.1.GA</version>
      </dependency>

      <dependency>
        <groupId>jboss</groupId>
        <artifactId>jboss-serialization</artifactId>
        <version>1.0.3.GA</version>
      </dependency>

      <dependency>
        <groupId>mc4j</groupId>
        <artifactId>org-mc4j-ems</artifactId>
        <version>1.2.6</version>
      </dependency>

      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>sigar</artifactId>
        <version>1.6.0.14</version>
      </dependency>

      <dependency>
        <groupId>org.hyperic</groupId>
        <artifactId>sigar-dist</artifactId>
        <version>1.6.0.14</version>
        <type>zip</type>
      </dependency>

      <dependency>
        <groupId>org.richfaces.framework</groupId>
        <artifactId>richfaces-api</artifactId>
        <version>3.3.0.GA</version>
      </dependency>

      <dependency>
        <groupId>org.richfaces.framework</groupId>
        <artifactId>richfaces-impl</artifactId>
        <version>3.3.0.GA</version>
      </dependency>

      <dependency>
        <groupId>org.richfaces.ui</groupId>
        <artifactId>richfaces-ui</artifactId>
        <version>3.3.0.GA</version>
      </dependency>

      <dependency>
        <groupId>oswego-concurrent</groupId>
        <artifactId>concurrent</artifactId>
        <version>1.3.4-jboss</version>
      </dependency>

      <!-- Postgres JDBC driver -->
      <dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>8.3-604.jdbc3</version>
      </dependency>

    </dependencies>

  </dependencyManagement>

  <dependencies>

    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>i18nlog</groupId>
      <artifactId>i18nlog</artifactId>
      <version>1.0.9</version>
    </dependency>

    <!-- for the JAXB annotations -->
    <dependency>
       <groupId>javax.xml.bind</groupId>
       <artifactId>jaxb-api</artifactId>
       <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.14</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>5.7</version>
      <scope>test</scope>
      <classifier>jdk15</classifier>
    </dependency>

    <!-- for the Nullable/NotNull annotations -->
    <dependency>
      <groupId>org.jetbrains</groupId>
      <artifactId>annotations</artifactId>
      <version>7.0.2</version>
      <scope>provided</scope>
    </dependency>

  </dependencies>

  <build>

    <defaultGoal>install</defaultGoal>

     <pluginManagement>
       <plugins>
         <plugin>
           <artifactId>maven-antrun-plugin</artifactId>
           <version>1.3</version>
         </plugin>
         <plugin>
           <artifactId>maven-assembly-plugin</artifactId>
           <version>2.2-beta-2</version>
         </plugin>
         <plugin>
           <artifactId>maven-clean-plugin</artifactId>
           <version>2.2</version>
         </plugin>
         <plugin>
           <artifactId>maven-compiler-plugin</artifactId>
           <version>2.0.2</version>
         </plugin>
         <plugin>
           <artifactId>maven-dependency-plugin</artifactId>
           <version>2.0</version>
         </plugin>
         <plugin>
           <artifactId>maven-deploy-plugin</artifactId>
           <version>2.3</version>
         </plugin>
         <plugin>
           <artifactId>maven-ear-plugin</artifactId>
           <version>2.3.1</version>
         </plugin>
         <plugin>
           <artifactId>maven-enforcer-plugin</artifactId>
           <version>1.0-alpha-3</version>
         </plugin>
         <plugin>
           <artifactId>maven-ejb-plugin</artifactId>
           <version>2.1</version>
         </plugin>
         <plugin>
           <artifactId>maven-install-plugin</artifactId>
           <version>2.2</version>
         </plugin>
         <plugin>
           <artifactId>maven-jar-plugin</artifactId>
           <version>2.2</version>
         </plugin>
         <plugin>
           <artifactId>maven-javadoc-plugin</artifactId>
           <version>2.4</version>
         </plugin>
         <plugin>
           <artifactId>maven-plugin-plugin</artifactId>
           <version>2.4.1</version>
         </plugin>
         <plugin>
           <artifactId>maven-rar-plugin</artifactId>
           <version>2.2</version>
         </plugin>
         <plugin>
           <artifactId>maven-release-plugin</artifactId>
           <!-- NOTE: If http://jira.codehaus.org/browse/MRELEASE-300 resurfaces,
                      it may be necessary to rollback to 2.0-beta-6. -->
           <version>2.0-beta-9</version>
         </plugin>
         <plugin>
           <artifactId>maven-resources-plugin</artifactId>
           <version>2.2</version>
         </plugin>
         <plugin>
           <artifactId>maven-site-plugin</artifactId>
           <version>2.0-beta-6</version>
         </plugin>
         <plugin>
           <artifactId>maven-source-plugin</artifactId>
           <version>2.0.4</version>
         </plugin>
         <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.4.2</version>
         </plugin>
         <plugin>
           <artifactId>maven-war-plugin</artifactId>
           <version>2.1-alpha-1</version>
         </plugin>
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>buildnumber-maven-plugin</artifactId>
           <version>1.0-beta-2</version>
         </plugin>
       </plugins>
     </pluginManagement>

    <plugins>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <optimize>false</optimize>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
               <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
               <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
               <Build-Number>${buildNumber}</Build-Number>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <!-- IMPORTANT: Use enforce goal, rather than enforce-once goal, otherwise reactor
                              builds will fail due to http://jira.codehaus.org/browse/MENFORCER-11 -->
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>2.0</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>[1.5,1.8)</version> <!-- 1.5.x, 1.6.x, 1.7.x -->
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <updateDependencies>false</updateDependencies>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <trimStackTrace>false</trimStackTrace>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-idea-plugin</artifactId>
        <version>2.1</version>
        <configuration>
          <ideaVersion>6.x</ideaVersion>
          <downloadJavadocs>true</downloadJavadocs>
          <downloadSources>true</downloadSources>
        </configuration>
      </plugin>

    </plugins>

    <extensions>

      <!-- Add support for scm URLs in the distributionManagement section. -->
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-scm</artifactId>
        <version>1.0-beta-4</version>
      </extension>

      <!-- Add support for dav URLs in the distributionManagement section. -->
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-webdav</artifactId>
        <version>1.0-beta-2</version>
      </extension>

    </extensions>

  </build>

  <repositories>
    <repository>
      <id>jboss</id>
      <name>JBoss Repository</name>
      <url>http://repository.jboss.org/maven2/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>jboss</id>
      <name>JBoss Plugin Repository</name>
      <url>http://repository.jboss.org/maven2/</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

  <distributionManagement>
    <repository>
      <!-- Copy the distribution jar file to a local checkout of the JBoss repository.
           This variable can be set in ~/.m2/settings.xml or $M2_HOME/conf/settings.xml. -->
      <id>repository.jboss.org</id>
      <url>file://${maven.repository.root}</url>
    </repository>

    <snapshotRepository>
      <id>jboss-snapshots</id>
      <name>JBoss Snapshot Repository</name>
      <url>dav:https://snapshots.jboss.org/maven2/</url>
    </snapshotRepository>
  </distributionManagement>

  <modules>
    <module>modules</module>
  </modules>

  <profiles>

    <profile>
        <id>ojdbc-driver</id>

        <dependencies>
            <!-- Oracle JDBC driver - required only if you want to run the tests, or dbsetup, against Oracle.
                 Add a top level dependency if this profile is active to allow for db-required tests in any module.
                 The driver can not be packaged for OpenSource distributions due to licensing issues, and as such,
                 this profile should not be active by default. -->
            <dependency>
                <groupId>ojdbc14</groupId>
                <artifactId>ojdbc14</artifactId>
                <version>10.2.0.4.0</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.oracle</groupId>
                <artifactId>ojdbc5</artifactId>
                <version>11.1.0.7.0</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </profile>

    <profile>
     <id>dev</id>

     <properties>
        <!-- The below prop can be used by antrun scripts to check if the dev profile is enabled. -->
        <dev.profile.active>true</dev.profile.active>
     </properties>

     <build>
      <plugins>

       <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>validate</phase>
            <inherited>false</inherited>
            <configuration>
              <tasks>
                <echo>.                            !!!!!!! dev profile is active !!!!!!!</echo>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
       </plugin>

       <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <useFile>false</useFile>
        </configuration>
       </plugin>

      </plugins>
     </build>

    </profile>

      <profile>
         <id>test.debug</id>
         <activation>
            <property>
               <name>test.debug</name>
            </property>
         </activation>

         <properties>
            <!-- See: http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#debugForkedProcess -->
            <maven.surefire.debug>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8797,server=y,suspend=y</maven.surefire.debug>
         </properties>
      </profile>

      <!-- Set the java5.home prop to a Java5 JRE dir to enforce that only Java5 APIs are used. -->
      <profile>
         <id>check-java-api</id>

         <activation>
            <property>
               <name>java5.home</name>
            </property>
         </activation>

         <build>
           <plugins>
              <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                  <compilerArguments>
                    <bootclasspath>${java5.home}/lib/rt.jar${path.separator}${java5.home}/lib/jsse.jar${path.separator}${java5.home}/lib/jce.jar</bootclasspath>
                  </compilerArguments>
                </configuration>
              </plugin>
            </plugins>
          </build>
      </profile>

      <!--  use buildnumber plugin only if SVN metadata is present -->
      <profile>
         <id>build-number-generation</id>
         <activation>
            <file>
               <exists>.svn</exists>
            </file>
         </activation>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.codehaus.mojo</groupId>
                  <artifactId>buildnumber-maven-plugin</artifactId>
                  <executions>
                     <execution>
                        <phase>validate</phase>
                        <goals>
                           <goal>create</goal>
                        </goals>
                     </execution>
                     </executions>
                     <configuration>
                     <revisionOnScmFailure>0</revisionOnScmFailure>
                     <doCheck>false</doCheck>
                     <doUpdate>false</doUpdate>
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </profile>

      <!-- If SVN meta data is not configured, set buildNumber to 0 -->
      <!-- I think this can get removed - before buildnumber-maven-plugin 1.0-beta-2 -->
      <!-- there was no <revisionOnScmFailure> option, so this was our custom solution. -->
      <!--
      <profile>
         <id>build-number-provided</id>
         <activation>
            <file>
               <missing>.svn</missing>
            </file>
         </activation>

         <properties>
            <buildNumber>0</buildNumber>
         </properties>
      </profile>
      -->
  </profiles>

</project>
