<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.rhq</groupId>
      <artifactId>rhq-parent</artifactId>
      <version>3.0.0.EmbJopr2</version>
   </parent>

   <groupId>org.rhq</groupId>
   <artifactId>rhq-portal</artifactId>
   <packaging>war</packaging>

   <name>RHQ Enterprise Portal</name>
   <description>the RHQ Enterprise Portal webapp</description>

   <scm>
      <connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/gui/portal-war/</connection>
      <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/enterprise/gui/portal-war/</developerConnection>
   </scm>


   <properties>
      <scm.module.path>modules/enterprise/gui/portal-war/</scm.module.path>

      <!-- dependency versions -->
      <el.version>1.0</el.version>
      <jsf-facelets.version>1.1.15.B1</jsf-facelets.version>
      <seam.version>2.1.0.SP1</seam.version>

      <!-- plugin versions -->
      <jetty-jspc-maven-plugin.version>7.0.1.v20091125</jetty-jspc-maven-plugin.version>

      <!-- Note: The product info properties now live in the RHQ root pom. -->
   </properties>


   <dependencies>

       <!-- Internal Deps -->

      <dependency>
         <groupId>org.rhq</groupId>
         <artifactId>rhq-core-domain</artifactId>
         <version>${project.version}</version>
         <scope>provided</scope> <!-- by rhq.ear (as ejb-jar) -->
      </dependency>

      <dependency>
         <groupId>org.rhq</groupId>
         <artifactId>rhq-core-gui</artifactId>
         <version>${project.version}</version>
      </dependency>

      <dependency>
         <groupId>org.rhq</groupId>
         <artifactId>rhq-enterprise-server</artifactId>
         <version>${project.version}</version>
         <scope>provided</scope> <!-- by rhq.ear (as ejb-jar) -->
      </dependency>

      <dependency>
         <groupId>org.rhq</groupId>
         <artifactId>rhq-core-util</artifactId>
         <version>${project.version}</version>
         <scope>provided</scope> <!-- by rhq.ear -->
      </dependency>

      <!-- 3rd Party Deps -->

      <dependency>
         <groupId>com.sun.facelets</groupId>
         <artifactId>jsf-facelets</artifactId>
         <version>1.1.15.B1</version>
      </dependency>

      <!-- NOTE: Do *not* set this to provided scope. The version that comes with AS 4.2 is not compatible w/ Ajax4JSF. -->
      <dependency>
         <groupId>commons-collections</groupId>
         <artifactId>commons-collections</artifactId>
         <version>3.2</version>
      </dependency>

      <dependency>
         <groupId>commons-dbcp</groupId>
         <artifactId>commons-dbcp</artifactId>
         <version>1.2.1</version>
      </dependency>

      <dependency>
         <groupId>commons-el</groupId>
         <artifactId>commons-el</artifactId>
         <version>1.0</version>
      </dependency>

      <dependency>
         <groupId>commons-fileupload</groupId>
         <artifactId>commons-fileupload</artifactId>
         <version>1.2</version>
      </dependency>

      <dependency>
         <groupId>commons-httpclient</groupId>
         <artifactId>commons-httpclient</artifactId>
         <version>3.0.1</version>
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <dependency>
         <groupId>commons-io</groupId>
         <artifactId>commons-io</artifactId>
         <version>1.3.1</version>
      </dependency>

      <dependency>
         <groupId>commons-logging</groupId>
         <artifactId>commons-logging</artifactId>
         <version>1.0.4</version>
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <dependency>
         <groupId>commons-validator</groupId>
         <artifactId>commons-validator</artifactId>
         <version>1.1.4</version>
      </dependency>

      <dependency>
         <groupId>hibernate</groupId>
         <artifactId>hibernate3</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <!-- used by a test JSP -->
      <dependency>
         <groupId>hibernate-entitymanager</groupId>
         <artifactId>hibernate-entitymanager</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <!-- needed for referenced domain entities that use Hibernate annotations (due to JDK5 bug) -->
      <dependency>
         <groupId>hibernate-annotations</groupId>
         <artifactId>hibernate-annotations</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <dependency>
         <groupId>javax.el</groupId>
         <artifactId>el-api</artifactId>
         <version>1.0</version>
         <scope>provided</scope> <!-- by JBossAS Tomcat -->
      </dependency>

      <!-- transitive dependency needed for JspC -->
      <dependency>
         <groupId>javax.servlet</groupId>
         <artifactId>servlet-api</artifactId>
         <version>2.4</version>
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <dependency>
         <groupId>javax.servlet</groupId>
         <artifactId>jsp-api</artifactId>
         <version>2.0</version>
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <dependency>
         <groupId>javax.faces</groupId>
         <artifactId>jsf-api</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <!-- We leverage a few utility classes (HtmlUtils, etc.) from the JSF RI impl jar. -->
      <dependency>
         <groupId>javax.faces</groupId>
         <artifactId>jsf-impl</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
         <artifactId>geronimo-javamail_1.3.1_spec</artifactId>
         <!-- The Sun javamail jar isn't available from a public repo due to licensing issues,
              so use the Geronimo one instead. -->
         <version>1.3</version>
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <!-- needed for referenced domain entities that use JPA annotations (due to JDK5 bug) -->
      <dependency>
         <groupId>javax.persistence</groupId>
         <artifactId>persistence-api</artifactId>
         <version>1.0</version>
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <dependency>
         <groupId>javax.servlet</groupId>
         <artifactId>jstl</artifactId>
         <version>1.1.2</version>
      </dependency>

      <!-- needed for EJB3 annotations (e.g. ApplicationException) -->
      <dependency>
         <groupId>jboss</groupId>
         <artifactId>jboss-ejb3x</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <dependency>
         <groupId>jboss</groupId>
         <artifactId>jboss-j2ee</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <!-- used by org.jboss.on.enterprise.ui.servlet.startupShutdownListener -->
      <dependency>
         <groupId>jboss</groupId>
         <artifactId>jboss-system</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <!-- used by org.jboss.on.enterprise.ui.converter.MD5HashConverter -->
      <dependency>
         <groupId>jboss</groupId>
         <artifactId>jbosssx</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <!-- Needed due to JDK 1.5 bug. -->
      <dependency>
         <groupId>jboss</groupId>
         <artifactId>jboss-annotations-ejb3</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <!-- used by DisplayTag_test.jsp -->
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>3.8.2</version>
      </dependency>

      <dependency>
         <groupId>org.opensymphony.quartz</groupId>
         <artifactId>quartz</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
         <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
      </dependency>

      <dependency>
         <groupId>org.opensymphony.quartz</groupId>
         <artifactId>quartz-oracle</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
         <scope>provided</scope> <!-- by JBossAS itself, which the container build has packaged with 1.6.5 -->
      </dependency>

      <!-- == Seam Related Dependencies ================ -->

      <dependency>
         <groupId>org.jboss.seam</groupId>
         <artifactId>jboss-seam</artifactId>
         <version>2.1.0.SP1</version>
         <exclusions>
             <exclusion>
               <groupId>xml-apis</groupId>
               <artifactId>xml-apis</artifactId>
             </exclusion>
         </exclusions>
      </dependency>

      <dependency>
         <groupId>org.jboss.seam</groupId>
         <artifactId>jboss-seam-ui</artifactId>
         <version>2.1.0.SP1</version>
      </dependency>

      <dependency>
         <groupId>org.jboss.seam</groupId>
         <artifactId>jboss-seam-debug</artifactId>
         <version>2.1.0.SP1</version>
         <!-- should be pulling this in directly ourselves, not relying
            jboss-seam-debug to provide it -->
         <exclusions>
            <exclusion>
               <groupId>com.sun.facelets</groupId>
               <artifactId>jsf-facelets</artifactId>
            </exclusion>
         </exclusions>
         <scope>runtime</scope>
      </dependency>

      <dependency>
         <groupId>org.jvnet</groupId>
         <artifactId>inflector</artifactId>
         <version>0.7.0</version>
      </dependency>

      <dependency>
         <groupId>org.richfaces.framework</groupId>
         <artifactId>richfaces-api</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
      </dependency>

      <dependency>
         <groupId>org.richfaces.framework</groupId>
         <artifactId>richfaces-impl</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
      </dependency>

      <dependency>
         <groupId>org.richfaces.ui</groupId>
         <artifactId>richfaces-ui</artifactId>
         <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
      </dependency>

      <dependency>
         <groupId>struts</groupId>
         <artifactId>struts</artifactId>
         <version>1.2.9</version>
         <exclusions>
            <exclusion>
               <groupId>antlr</groupId>
               <artifactId>antlr</artifactId>
               <!-- provided by JBossAS default config -->
            </exclusion>
         </exclusions>
      </dependency>

      <dependency>
         <groupId>struts</groupId>
         <artifactId>struts-el</artifactId>
         <version>1.2.9</version>
      </dependency>

      <dependency>
         <groupId>struts-menu</groupId>
         <artifactId>struts-menu</artifactId>
         <version>2.3</version>
      </dependency>

      <dependency>
         <groupId>taglibs</groupId>
         <artifactId>standard</artifactId>
         <version>1.1.2</version>
      </dependency>

      <dependency>
          <groupId>jboss.jbossws</groupId>
          <artifactId>jboss-jaxws</artifactId>
          <version>3.0.1-native-2.0.4.GA</version>
          <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <dependency>
         <groupId>xalan</groupId>
         <artifactId>xalan</artifactId>
         <version>2.5.1</version>
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <dependency>
         <groupId>xerces</groupId>
         <artifactId>xercesImpl</artifactId>
         <version>2.0.2</version>
         <scope>provided</scope> <!-- by JBossAS -->
      </dependency>

      <!-- ============ Testing ========================-->
      <dependency>
          <groupId>jboss</groupId>
          <artifactId>javassist</artifactId>
          <scope>test</scope>
      </dependency>

      <dependency>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>groovy-all</artifactId>
          <version>1.6.4</version>
      </dependency>

   </dependencies>


   <build>
      <finalName>rhq-portal</finalName>
      <plugins>

          <plugin>
              <groupId>org.codehaus.groovy.maven</groupId>
              <artifactId>gmaven-plugin</artifactId>
              <version>1.0</version>
              <executions>
                  <execution>
                      <goals>
                          <goal>compile</goal>
                          <goal>testCompile</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>

         <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
               <webResources>
                  <resource>
                     <filtering>false</filtering>
                     <directory>${basedir}/src/main/webapp</directory>
                  </resource>
                  <resource>
                     <filtering>true</filtering>
                     <directory>${basedir}/src/main/webapp-filtered</directory>
                  </resource>
               </webResources>
            </configuration>
         </plugin>

         <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
               <execution>
                  <id>Generate I18N Resource Bundles</id>
                  <phase>process-classes</phase>
                  <configuration>
                     <tasks>
                        <!-- generate the I18N resource bundles -->
                        <taskdef name="i18n" classpathref="maven.runtime.classpath" classname="mazz.i18n.ant.I18NAntTask" />
                        <i18n outputdir="${project.build.outputDirectory}" defaultlocale="en" verbose="false" append="false" verify="true">
                           <classpath refid="maven.runtime.classpath" />
                           <classfileset dir="${project.build.outputDirectory}">
                              <include name="**/*I18NResourceKeys.class" />
                           </classfileset>
                        </i18n>
                     </tasks>
                  </configuration>
                  <goals>
                     <goal>run</goal>
                  </goals>
               </execution>
               <execution>
                  <id>Maintain an unfiltered copy of i18n properties files</id>
                  <phase>process-classes</phase>
                  <configuration>
                     <tasks>
                        <copy todir="${project.build.outputDirectory}">
                           <fileset dir="src/main/webapp-filtered/WEB-INF/classes">
                              <include name="ApplicationResources.properties" />
                           </fileset>
                           <mapper type="glob" from="*" to="*.unfiltered" />
                        </copy>
                     </tasks>
                  </configuration>
                  <goals>
                     <goal>run</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>

      </plugins>

   </build>


   <profiles>

      <profile>
         <id>dev</id>

         <properties>
            <rhq.rootDir>../../../..</rhq.rootDir>
            <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
            <rhq.deploymentName>${project.build.finalName}.war</rhq.deploymentName>
            <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/${rhq.deploymentName}</rhq.deploymentDir>
         </properties>

         <build>
            <plugins>

               <plugin>
                 <artifactId>maven-antrun-plugin</artifactId>
                 <version>1.1</version>
                 <executions>

                     <execution>
                        <id>deploy-classes</id>
                        <phase>compile</phase>
                        <configuration>
                          <tasks>
                            <property name="classes.dir" location="${rhq.deploymentDir}/WEB-INF/classes" />
                            <echo>*** Copying updated files from target/classes to ${classes.dir}...</echo>
                            <copy todir="${classes.dir}" verbose="${rhq.verbose}">
                               <fileset dir="target/classes" />
                            </copy>
                            <property name="deployment.dir" location="${rhq.deploymentDir}" />
                            <echo>*** Copying updated files from src${file.separator}main${file.separator}webapp${file.separator} to ${deployment.dir}${file.separator}...</echo>
                            <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
                               <fileset dir="${basedir}/src/main/webapp" />
                            </copy>
                            <!-- TODO: Also copy the files from src/main/webapp-filtered/, and then filter them ourselves. -->
                          </tasks>
                        </configuration>
                        <goals>
                          <goal>run</goal>
                        </goals>
                     </execution>

                     <execution>
                        <id>deploy</id>
                        <phase>package</phase>
                        <configuration>
                          <tasks>
                            <property name="deployment.dir" location="${rhq.deploymentDir}" />
                            <echo>*** Copying updated files from target${file.separator}${project.build.finalName}${file.separator} to ${deployment.dir}${file.separator}...</echo>
                            <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
                               <fileset dir="${basedir}/target/${project.build.finalName}" />
                            </copy>
                          </tasks>
                        </configuration>
                        <goals>
                          <goal>run</goal>
                        </goals>
                     </execution>

                     <execution>
                        <id>undeploy</id>
                        <phase>clean</phase>
                        <configuration>
                          <tasks>
                            <property name="deployment.dir" location="${rhq.deploymentDir}" />
                            <echo>*** Deleting ${deployment.dir}${file.separator}...</echo>
                            <delete dir="${deployment.dir}" />
                          </tasks>
                        </configuration>
                        <goals>
                          <goal>run</goal>
                        </goals>
                     </execution>

                  </executions>
               </plugin>

            </plugins>
         </build>
      </profile>

      <profile>
         <id>dist</id>

         <build>
            <plugins>

               <plugin>
                  <!-- See http://jetty.mortbay.org/jspc-maven-plugin/ -->
                  <groupId>org.mortbay.jetty</groupId>
                  <artifactId>jetty-jspc-maven-plugin</artifactId>
                  <version>7.0.1.v20091125</version>
                  <configuration>
                     <keepSources>false</keepSources>
                     <validateXml>false</validateXml>
                     <generatedClasses>${project.build.outputDirectory}</generatedClasses>
                  </configuration>
                  <executions>
                     <execution><goals><goal>jspc</goal></goals></execution>
                  </executions>
               </plugin>

            </plugins>
         </build>
      </profile>

   </profiles>


   <repositories>

      <repository>
         <id>java.net-m1-releases</id>
         <name>Java.net Maven1 Repository - for javax.faces, javax.el, com.sun.el, and com.sun.facelets releases</name>
         <url>http://download.java.net/maven/1/</url>
         <layout>legacy</layout>
      </repository>

   </repositories>

</project>
