<?xml version="1.0" encoding="UTF-8"?>
<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.jboss.weld</groupId>
      <artifactId>weld-core-parent</artifactId>
      <version>1.1.0.Final</version>
      <relativePath>../parent/pom.xml</relativePath>
   </parent>
   <groupId>org.jboss.weld.examples</groupId>
   <artifactId>weld-examples-parent</artifactId>
  <version>1.1.0.Final</version>
   <packaging>pom</packaging>
   <name>Weld Examples</name>

   <description>
      Examples for Weld, the reference implementation of JSR 299: Contexts and Dependency Injection for Java EE
   </description>

   <url>http://www.seamframework.org/Weld</url>

   <developers>
      <developer>
         <name>Pete Muir</name>
         <roles>
            <role>Project Lead</role>
         </roles>
         <email>pete.muir@jboss.org</email>
         <organization>JBoss, a division of Red Hat</organization>
         <url>http://in.relation.to/Bloggers/Pete</url>
      </developer>

      <developer>
         <name>Shane Bryzak</name>
         <organization>JBoss, a division of Red Hat</organization>
      </developer>

      <developer>
         <name>David Allen</name>
      </developer>

      <developer>
         <name>Nicklas Karlsson</name>
      </developer>

      <developer>
         <name>Clint Popetz</name>
      </developer>

      <developer>
         <name>Pete Royle</name>
      </developer>

   </developers>
   <ciManagement>
      <system>Hudson</system>
      <url>http://hudson.jboss.org</url>
   </ciManagement>

   <issueManagement>
      <system>JIRA</system>
      <url>http://jira.jboss.org/browse/WELD</url>
   </issueManagement>

   <organization>
      <name>Seam Framework</name>
      <url>http://seamframework.org</url>
   </organization>

   <inceptionYear>2008</inceptionYear>

   <licenses>
      <license>
         <name>Apache License, Version 2.0</name>
         <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      </license>
   </licenses>

   <modules>
      <module>jsf/numberguess</module>
      <module>jsf/translator</module>
      <module>jsf/login</module>
      <module>jsf/permalink</module>
      <module>jsf/pastecode</module>
      <module>se/numberguess</module>
      <module>se/hello-world</module>
   </modules>

   <properties>
      <!-- Override JSF version to 2.0 -->
      <jsf.version>2.0.2-FCS</jsf.version>
      <facelets.version>1.1.15</facelets.version>
      <jetty.version>6.1.21</jetty.version>
      <!-- UEL Impl -->
      <uel.version>2.2</uel.version>
      <!-- Testing deps -->
      <selenium.java.client.version>1.0.1</selenium.java.client.version>
      <ant.junit.version>1.6.2</ant.junit.version>
      <ftest.version.discriminator />
      <selenium.browser>*firefoxproxy</selenium.browser>
      <selenium.browser.url>http://localhost:8080</selenium.browser.url>
      <selenium.server.port>14444</selenium.server.port>
      <selenium.server.host>localhost</selenium.server.host>
      <selenium.speed>0</selenium.speed>
      <selenium.timeout>30000</selenium.timeout>
      <selenium.debug>false</selenium.debug>
      <selenium.log.dir>${project.build.directory}/ftest-logs</selenium.log.dir>
      <application.deploy.timeout>300</application.deploy.timeout>
      <richfaces.selenium.version>1.5.1.Final</richfaces.selenium.version>
      <ftest.sources.directory>src/ftest/java</ftest.sources.directory>
      <ftest.resources.directory>src/ftest/resources</ftest.resources.directory>
      <!-- richfaces-selenium -->
      <browserSessionReuse>true</browserSessionReuse>
      <cargo.jvmargs.additional />
      <cargo.timeout.deploy>120000</cargo.timeout.deploy>
      <context.host>localhost</context.host>
      <context.root>http://${context.host}:8080/</context.root>
      <context.path>/${project.build.finalName}/</context.path>
      <context.deploy.path>${context.path}</context.deploy.path>
      <jboss.master.configuration>${env.JBOSS_HOME}/server/all</jboss.master.configuration>
      <deployable.location />
      <deployable.type>war</deployable.type>
      <method>*</method>
      <selenium.maximize>false</selenium.maximize>
      <selenium.timeout.ajax>15000</selenium.timeout.ajax>
      <selenium.timeout.default>30000</selenium.timeout.default>
      <selenium.timeout.gui>5000</selenium.timeout.gui>
      <selenium.timeout.model>30000</selenium.timeout.model>
   </properties>

   <dependencyManagement>
      <dependencies>

         <dependency>
            <groupId>javax.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>${jsf.version}</version>
         </dependency>

         <dependency>
            <groupId>javax.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>${jsf.version}</version>
         </dependency>

         <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty</artifactId>
            <version>${jetty.version}</version>
         </dependency>

         <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-plus</artifactId>
            <version>${jetty.version}</version>
         </dependency>

         <dependency>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jsp-2.1-jetty</artifactId>
            <version>${jetty.version}</version>
         </dependency>

         <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>el-impl</artifactId>
            <version>${uel.version}</version>
         </dependency>

         <dependency>
            <groupId>org.seleniumhq.selenium.client-drivers</groupId>
            <artifactId>selenium-java-client-driver</artifactId>
            <version>${selenium.java.client.version}</version>
         </dependency>

      </dependencies>
   </dependencyManagement>

   <build>
      <pluginManagement>
         <plugins>
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-ejb-plugin</artifactId>
               <configuration>
                  <ejbVersion>3.0</ejbVersion>
               </configuration>
            </plugin>
            <plugin>
               <groupId>org.codehaus.cargo</groupId>
               <artifactId>cargo-maven2-plugin</artifactId>
            </plugin>
            <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>selenium-maven-plugin</artifactId>
            </plugin>
            <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>failsafe-maven-plugin</artifactId>
            </plugin>
             <!--
                  Work around issues encountered with http://jira.codehaus.org/browse/MWAR-187
                  during release
             -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-war-plugin</artifactId>
                 <configuration>
                     <useCache>false</useCache>
                 </configuration>
             </plugin>
         </plugins>
      </pluginManagement>
   </build>

   <profiles>
      <profile>
         <id>ftest-jboss-remote-6</id>
         <properties>
            <ftest.suite.xml>jboss6x.xml</ftest.suite.xml>
         </properties>

         <dependencies>
            <dependency>
               <groupId>org.seleniumhq.selenium.client-drivers</groupId>
               <artifactId>selenium-java-client-driver</artifactId>
               <scope>test</scope>
            </dependency>
            <dependency>
               <groupId>org.jboss.test</groupId>
               <artifactId>richfaces-selenium</artifactId>
               <version>${richfaces.selenium.version}</version>
               <scope>test</scope>
            </dependency>
         </dependencies>

         <build>
            <pluginManagement>
               <plugins>
                  <!-- skip unit tests when running functional tests -->
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
                     <configuration>
                        <skip>true</skip>
                     </configuration>
                  </plugin>

                  <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>build-helper-maven-plugin</artifactId>
                     <executions>
                        <execution>
                           <id>add-ftest-source</id>
                           <goals>
                              <goal>add-test-source</goal>
                           </goals>
                           <configuration>
                              <sources>
                                 <source>${ftest.sources.directory}</source>
                              </sources>
                           </configuration>
                        </execution>
                     </executions>
                  </plugin>


                  <!-- deploy/undeploy application archive to/from container -->
                  <plugin>
                     <groupId>org.codehaus.cargo</groupId>
                     <artifactId>cargo-maven2-plugin</artifactId>
                     <configuration>
                        <container>
                           <containerId>jboss5x</containerId>
                           <type>remote</type>
                        </container>
                        <configuration>
                           <type>runtime</type>
                        </configuration>
                     </configuration>
                     <executions>
                        <execution>
                           <id>deploy</id>
                           <phase>pre-integration-test</phase>
                           <goals>
                              <goal>deploy</goal>
                           </goals>
                        </execution>
                        <execution>
                           <id>undeploy</id>
                           <phase>post-integration-test</phase>
                           <goals>
                              <goal>undeploy</goal>
                           </goals>
                        </execution>
                     </executions>
                  </plugin>

                  <!--  start Selenium server -->
                  <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>selenium-maven-plugin</artifactId>
                     <executions>
                        <execution>
                           <id>start-selenium</id>
                           <phase>pre-integration-test</phase>
                           <goals>
                              <goal>start-server</goal>
                           </goals>
                           <configuration>
                              <background>true</background>
                              <port>${selenium.server.port}</port>
                              <logOutput>true</logOutput>
                              <logFile>${selenium.log.dir}/selenium-server.log</logFile>
                              <browserSideLog>${selenium.debug}</browserSideLog>
                              <debug>${selenium.debug}</debug>
                           </configuration>
                        </execution>
                     </executions>
                  </plugin>

                  <!-- run functional tests -->
                  <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>failsafe-maven-plugin</artifactId>
                     <configuration>
                        <suiteXmlFiles>
                           <suiteXmlFile>${ftest.resources.directory}/${ftest.suite.xml}</suiteXmlFile>
                        </suiteXmlFiles>
                        <argLine>-Xmx748m</argLine>
                        <forkMode>once</forkMode>
                        <systemProperties>
                           <property>
                              <name>method</name>
                              <value>${method}</value>
                           </property>
                           <property>
                              <name>browser</name>
                              <value>${selenium.browser}</value>
                           </property>
                           <property>
                              <name>context.root</name>
                              <value>${context.root}</value>
                           </property>
                           <property>
                              <name>context.path</name>
                              <value>${context.path}</value>
                           </property>
                           <property>
                              <name>selenium.host</name>
                              <value>${selenium.server.host}</value>
                           </property>
                           <property>
                              <name>selenium.port</name>
                              <value>${selenium.server.port}</value>
                           </property>
                           <property>
                              <name>selenium.debug</name>
                              <value>${selenium.debug}</value>
                           </property>
                           <property>
                              <name>selenium.maximize</name>
                              <value>${selenium.maximize}</value>
                           </property>
                           <property>
                              <name>maven.resources.dir</name>
                              <value>${resources.dir}</value>
                           </property>
                           <property>
                              <name>maven.project.build.directory</name>
                              <value>${project.build.directory}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.default</name>
                              <value>${selenium.timeout.default}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.gui</name>
                              <value>${selenium.timeout.gui}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.ajax</name>
                              <value>${selenium.timeout.ajax}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.model</name>
                              <value>${selenium.timeout.model}</value>
                           </property>
                           <property>
                              <name>selenium.speed</name>
                              <value>${selenium.speed}</value>
                           </property>
                           <property>
                              <name>selenium.timeout</name>
                              <value>${selenium.timeout}</value>
                           </property>
                           <property>
                              <name>basedir</name>
                              <value>${basedir}</value>
                           </property>
                        </systemProperties>
                     </configuration>
                     <executions>
                        <execution>
                           <id>verify</id>
                           <phase>verify</phase>
                           <goals>
                              <goal>verify</goal>
                           </goals>
                        </execution>
                        <execution>
                           <id>integration-test</id>
                           <phase>integration-test</phase>
                           <goals>
                              <goal>integration-test</goal>
                           </goals>
                        </execution>
                     </executions>
                  </plugin>


                  <!-- stop Selenium -->
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-antrun-plugin</artifactId>

                     <executions>
                        <execution>
                           <!-- this ant script runs testng natively -->
                           <id>stop-selenium</id>
                           <phase>post-integration-test</phase>
                           <configuration>
                              <tasks>
                                 <echo taskname="selenium-shutdown" message="DGF Errors during shutdown are expected" />
                                 <get taskname="selenium-shutdown" src="http://${selenium.server.host}:${selenium.server.port}/selenium-server/driver/?cmd=shutDownSeleniumServer" ignoreerrors="true" dest="${selenium.log.dir}/selenium.stop.msg" />
                              </tasks>
                           </configuration>
                           <goals>
                              <goal>run</goal>
                           </goals>
                        </execution>
                     </executions>
                  </plugin>
               </plugins>
            </pluginManagement>
         </build>
      </profile>

      <!-- PROFILE USED TO RUN CLUSTERING FTESTS ON JBOSS AS 6.0.* -->
      <profile>
         <id>ftest-jboss-cluster-6</id>
         <properties>
            <ftest.suite.xml>jboss6x-cluster.xml</ftest.suite.xml>
         </properties>
         
         <dependencies>
            <dependency>
               <groupId>org.seleniumhq.selenium.client-drivers</groupId>
               <artifactId>selenium-java-client-driver</artifactId>
               <scope>test</scope>
            </dependency>
            <dependency>
               <groupId>org.jboss.test</groupId>
               <artifactId>richfaces-selenium</artifactId>
               <version>${richfaces.selenium.version}</version>
               <scope>test</scope>
            </dependency>
         </dependencies>

         <build>
            <pluginManagement>
               <plugins>
                  <!-- skip unit tests when running functional tests -->
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
                     <configuration>
                        <skip>true</skip>
                     </configuration>
                  </plugin>

                  <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>build-helper-maven-plugin</artifactId>
                     <executions>
                        <execution>
                           <id>add-ftest-source</id>
                           <goals>
                              <goal>add-test-source</goal>
                           </goals>
                           <configuration>
                              <sources>
                                 <source>${ftest.sources.directory}</source>
                              </sources>
                           </configuration>
                        </execution>
                     </executions>
                  </plugin>

                  <!--  start Selenium server -->
                  <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>selenium-maven-plugin</artifactId>
                     <executions>
                        <execution>
                           <id>start-selenium</id>
                           <phase>pre-integration-test</phase>
                           <goals>
                              <goal>start-server</goal>
                           </goals>
                           <configuration>
                              <background>true</background>
                              <port>${selenium.server.port}</port>
                              <logOutput>true</logOutput>
                              <logFile>${selenium.log.dir}/selenium-server.log</logFile>
                              <browserSideLog>${selenium.debug}</browserSideLog>
                              <debug>${selenium.debug}</debug>
                           </configuration>
                        </execution>
                     </executions>
                  </plugin>

                  <!-- run functional tests -->
                  <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>failsafe-maven-plugin</artifactId>
                     <configuration>
                        <suiteXmlFiles>
                           <suiteXmlFile>${ftest.resources.directory}/${ftest.suite.xml}</suiteXmlFile>
                        </suiteXmlFiles>
                        <argLine>-Xmx748m</argLine>
                        <forkMode>once</forkMode>
                        <systemProperties>
                           <property>
                              <name>method</name>
                              <value>${method}</value>
                           </property>
                           <property>
                              <name>browser</name>
                              <value>${selenium.browser}</value>
                           </property>
                           <property>
                              <name>context.root</name>
                              <value>${context.root}</value>
                           </property>
                           <property>
                              <name>context.path</name>
                              <value>${context.path}</value>
                           </property>
                           <property>
                              <name>selenium.host</name>
                              <value>${selenium.server.host}</value>
                           </property>
                           <property>
                              <name>selenium.port</name>
                              <value>${selenium.server.port}</value>
                           </property>
                           <property>
                              <name>selenium.debug</name>
                              <value>${selenium.debug}</value>
                           </property>
                           <property>
                              <name>selenium.maximize</name>
                              <value>${selenium.maximize}</value>
                           </property>
                           <property>
                              <name>maven.resources.dir</name>
                              <value>${resources.dir}</value>
                           </property>
                           <property>
                              <name>maven.project.build.directory</name>
                              <value>${project.build.directory}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.default</name>
                              <value>${selenium.timeout.default}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.gui</name>
                              <value>${selenium.timeout.gui}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.ajax</name>
                              <value>${selenium.timeout.ajax}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.model</name>
                              <value>${selenium.timeout.model}</value>
                           </property>
                           <property>
                              <name>selenium.speed</name>
                              <value>${selenium.speed}</value>
                           </property>
                           <property>
                              <name>selenium.timeout</name>
                              <value>${selenium.timeout}</value>
                           </property>
                           <property>
                              <name>basedir</name>
                              <value>${basedir}</value>
                           </property>
                           <property>
                              <name>jboss.config</name>
                              <value>${jboss.master.configuration}</value>
                           </property>
                        </systemProperties>
                     </configuration>
                     <executions>
                        <execution>
                           <id>integration-test</id>
                           <phase>integration-test</phase>
                           <goals>
                              <goal>integration-test</goal>
                           </goals>
                        </execution>
                        <execution>
                           <id>verify</id>
                           <phase>verify</phase>
                           <goals>
                              <goal>verify</goal>
                           </goals>
                        </execution>
                     </executions>
                  </plugin>


                  <!-- stop Selenium -->
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-antrun-plugin</artifactId>

                     <executions>
                        <!--
                           deploy application to farm directory and
                           waiting for the application to be ready
                        -->
                        <execution>
                           <id>farm-example</id>
                           <phase>pre-integration-test</phase>
                           <configuration>
                              <tasks>
                                 <property name="url.to.wait" value="http://localhost:8180/${project.build.finalName}" />
                                 <copy file="${project.build.directory}/${project.build.finalName}.${project.packaging}" toDir="${jboss.master.configuration}/farm" />
                                 <echo message="Waiting for application at ${url.to.wait}" />
                                 <waitfor maxwait="${application.deploy.timeout}" maxwaitunit="second">
                                    <http url="${url.to.wait}" errorsBeginAt="404" />
                                 </waitfor>
                              </tasks>
                           </configuration>
                           <goals>
                              <goal>run</goal>
                           </goals>
                        </execution>

                        <!-- this ant script runs testng natively -->
                        <execution>
                           <id>stop-selenium</id>
                           <phase>post-integration-test</phase>
                           <configuration>
                              <tasks>
                                 <echo message="Undeploying application." />
                                 <delete file="${jboss.master.configuration}/farm/${project.build.finalName}.${project.packaging}" />
                                 <get taskname="selenium-shutdown" src="http://${selenium.server.host}:${selenium.server.port}/selenium-server/driver/?cmd=shutDownSeleniumServer" ignoreerrors="true" dest="${selenium.log.dir}/selenium.stop.msg" />
                                 <echo taskname="selenium-shutdown" message="DGF Errors during shutdown are expected." />
                              </tasks>
                           </configuration>
                           <goals>
                              <goal>run</goal>
                           </goals>
                        </execution>

                     </executions>
                  </plugin>
               </plugins>
            </pluginManagement>
         </build>
      </profile>
      
      <profile>
         <id>ftest-tomcat-6</id>
         <properties>
            <ftest.suite.xml>tomcat6x.xml</ftest.suite.xml>
            <!--  Before starting Tomcat, add the following line to conf/tomcat-users.xml to allow 
                  the Cargo plugin to access the manager application, then start Tomcat:
                  <user username="admin" password="" roles="manager" /> 
            -->
            <tomcat.username>admin</tomcat.username>
            <tomcat.password />
         </properties>
         
         <dependencies>
            <dependency>
               <groupId>org.seleniumhq.selenium.client-drivers</groupId>
               <artifactId>selenium-java-client-driver</artifactId>
               <scope>test</scope>
            </dependency>
            <dependency>
               <groupId>org.jboss.test</groupId>
               <artifactId>richfaces-selenium</artifactId>
               <version>${richfaces.selenium.version}</version>
               <scope>test</scope>
            </dependency>
         </dependencies>
         
         <build>
            <pluginManagement>
               <plugins>
                  <!-- skip unit tests when running functional tests -->
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
                     <configuration>
                        <skip>true</skip>
                     </configuration>
                  </plugin>

                  <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>build-helper-maven-plugin</artifactId>
                     <executions>
                        <execution>
                           <id>add-ftest-source</id>
                           <goals>
                              <goal>add-test-source</goal>
                           </goals>
                           <configuration>
                              <sources>
                                 <source>${ftest.sources.directory}</source>
                              </sources>
                           </configuration>
                        </execution>
                     </executions>
                  </plugin>

                  <!-- deploy/undeploy application archive to/from container -->
                  <plugin>
                     <groupId>org.codehaus.cargo</groupId>
                     <artifactId>cargo-maven2-plugin</artifactId>
                     <version>${cargo.maven2.plugin.version}</version>
                     <configuration>
                     <wait>true</wait>
                     <container>
                        <containerId>tomcat6x</containerId>
                        <type>remote</type>
                     </container>
                     <configuration>
                        <type>runtime</type> 
                        <properties>
                           <cargo.tomcat.manager.url>http://localhost:8080/manager</cargo.tomcat.manager.url>
                           <cargo.remote.username>${tomcat.username}</cargo.remote.username>
                           <cargo.remote.password>${tomcat.password}</cargo.remote.password>
                        </properties>
                     </configuration>
                     <deployer>
                        <type>remote</type>
                        <deployables>
                           <deployable>
                              <properties>
                                 <context>${project.build.finalName}</context>
                              </properties>
                              <groupId>${project.groupId}</groupId>
                              <artifactId>${project.artifactId}</artifactId>
                              <type>war</type>
                           </deployable>
                        </deployables>
                      </deployer>
                     </configuration>
                     <executions>
                        <execution>
                           <id>deploy</id>
                           <phase>pre-integration-test</phase>
                           <goals>
                              <goal>deployer-deploy</goal>
                           </goals>
                        </execution>
                        <execution>
                           <id>undeploy</id>
                           <phase>post-integration-test</phase>
                           <goals>
                              <goal>deployer-undeploy</goal>
                           </goals>
                        </execution>
                     </executions>
                  </plugin>
                  
                  <!--  start Selenium server -->
                  <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>selenium-maven-plugin</artifactId>
                     <version>${selenium.maven.plugin.version}</version>
                     <executions>
                        <execution>
                           <id>start-selenium</id>
                           <phase>pre-integration-test</phase>
                           <goals>
                              <goal>start-server</goal>
                           </goals>
                           <configuration>
                              <background>true</background>
                              <port>${selenium.server.port}</port>
                              <logOutput>true</logOutput>
                              <logFile>${selenium.log.dir}/selenium-server.log</logFile>
                              <browserSideLog>${selenium.debug}</browserSideLog>
                              <debug>${selenium.debug}</debug>
                           </configuration>
                        </execution>
                     </executions>
                  </plugin>
                  
                  <!-- run functional tests -->
                  <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>failsafe-maven-plugin</artifactId>
                     <configuration>
                        <suiteXmlFiles>
                           <suiteXmlFile>${ftest.resources.directory}/${ftest.suite.xml}</suiteXmlFile>
                        </suiteXmlFiles>
                        <argLine>-Xmx748m</argLine>
                        <forkMode>once</forkMode>
                        <systemProperties>
                           <property>
                              <name>method</name>
                              <value>${method}</value>
                           </property>
                           <property>
                              <name>browser</name>
                              <value>${selenium.browser}</value>
                           </property>
                           <property>
                              <name>context.root</name>
                              <value>${context.root}</value>
                           </property>
                           <property>
                              <name>context.path</name>
                              <value>${context.path}</value>
                           </property>
                           <property>
                              <name>selenium.host</name>
                              <value>${selenium.server.host}</value>
                           </property>
                           <property>
                              <name>selenium.port</name>
                              <value>${selenium.server.port}</value>
                           </property>
                           <property>
                              <name>selenium.debug</name>
                              <value>${selenium.debug}</value>
                           </property>
                           <property>
                              <name>selenium.maximize</name>
                              <value>${selenium.maximize}</value>
                           </property>
                           <property>
                              <name>maven.resources.dir</name>
                              <value>${resources.dir}</value>
                           </property>
                           <property>
                              <name>maven.project.build.directory</name>
                              <value>${project.build.directory}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.default</name>
                              <value>${selenium.timeout.default}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.gui</name>
                              <value>${selenium.timeout.gui}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.ajax</name>
                              <value>${selenium.timeout.ajax}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.model</name>
                              <value>${selenium.timeout.model}</value>
                           </property>
                           <property>
                              <name>selenium.maximize</name>
                              <value>${selenium.maximize}</value>
                           </property>
                           <property>
                              <name>maven.resources.dir</name>
                              <value>${resources.dir}</value>
                           </property>
                           <property>
                              <name>maven.project.build.directory</name>
                              <value>${project.build.directory}</value>
                           </property>
                        </systemProperties>
                     </configuration>
                     <executions>
                        <execution>
                           <id>verify</id>
                           <phase>verify</phase>
                           <goals>
                              <goal>verify</goal>
                           </goals>
                        </execution>
                        <execution>
                           <id>integration-test</id>
                           <phase>integration-test</phase>
                           <goals>
                              <goal>integration-test</goal>
                           </goals>
                        </execution>
                     </executions>
                  </plugin>

                  <!-- stop Selenium -->
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-antrun-plugin</artifactId>
                     <executions>
                        <execution>
                           <!-- this ant script runs testng natively -->
                           <id>stop-selenium</id>
                           <phase>post-integration-test</phase>
                           <configuration>
                              <tasks>
                                 <echo taskname="selenium-shutdown" message="DGF Errors during shutdown are expected" />
                                 <get taskname="selenium-shutdown" src="http://${selenium.server.host}:${selenium.server.port}/selenium-server/driver/?cmd=shutDownSeleniumServer" ignoreerrors="true" dest="${selenium.log.dir}/selenium.stop.msg" />
                              </tasks>
                           </configuration>
                           <goals>
                              <goal>run</goal>
                           </goals>
                        </execution>
                     </executions>
                  </plugin>
               </plugins>
            </pluginManagement>
         </build>
      </profile>

      <profile>
         <id>ftest-jetty-6</id>
         <properties>
            <ftest.suite.xml>jetty6x.xml</ftest.suite.xml>
            <jetty.http.port>9090</jetty.http.port>
            <context.root>http://${context.host}:${jetty.http.port}/</context.root>
         </properties>
         
         <dependencies>
            <dependency>
               <groupId>org.seleniumhq.selenium.client-drivers</groupId>
               <artifactId>selenium-java-client-driver</artifactId>
               <scope>test</scope>
            </dependency>
            <dependency>
               <groupId>org.jboss.test</groupId>
               <artifactId>richfaces-selenium</artifactId>
               <version>${richfaces.selenium.version}</version>
               <scope>test</scope>
            </dependency>
         </dependencies>
         
         <build>
            <pluginManagement>
               <plugins>
                  <!-- skip unit tests when running functional tests -->
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
                     <configuration>
                        <skip>true</skip>
                     </configuration>
                  </plugin>

                  <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>build-helper-maven-plugin</artifactId>
                     <executions>
                        <execution>
                           <id>add-ftest-source</id>
                           <goals>
                              <goal>add-test-source</goal>
                           </goals>
                           <configuration>
                              <sources>
                                 <source>${ftest.sources.directory}</source>
                              </sources>
                           </configuration>
                        </execution>
                     </executions>
                  </plugin>

                  <!-- deploy/undeploy application archive to/from container -->
                  <plugin>
                     <groupId>org.mortbay.jetty</groupId>
                     <artifactId>maven-jetty-plugin</artifactId>
                     <configuration>  
                        <connectors>
                           <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                              <port>${jetty.http.port}</port>
                              <maxIdleTime>3600000</maxIdleTime>
                           </connector>
                        </connectors>
                        <stopPort>9999</stopPort>
                        <stopKey>foo</stopKey>
                        <scanIntervalSeconds>10</scanIntervalSeconds>
                        <webAppSourceDirectory>${project.build.directory}/${project.build.finalName}</webAppSourceDirectory>
                        <overrideWebXml>src/main/webapp-jetty/WEB-INF/web.xml</overrideWebXml>
                        <jettyEnvXml>src/main/webapp-jetty/WEB-INF/jetty-env.xml</jettyEnvXml>
                     </configuration>
                     <executions>
                        <execution>
                           <id>start-jetty</id>
                           <phase>pre-integration-test</phase>
                           <goals>
                              <goal>run</goal>
                           </goals>
                           <configuration>
                              <scanIntervalSeconds>0</scanIntervalSeconds>
                              <daemon>true</daemon>
                           </configuration>
                        </execution>
                        <execution>
                           <id>stop-jetty</id>
                           <phase>post-integration-test</phase>
                           <goals>
                              <goal>stop</goal>
                           </goals>
                        </execution>
                     </executions>
                  </plugin>
                  
                  <!--  start Selenium server -->
                  <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>selenium-maven-plugin</artifactId>
                     <version>${selenium.maven.plugin.version}</version>
                     <executions>
                        <execution>
                           <id>start-selenium</id>
                           <phase>pre-integration-test</phase>
                           <goals>
                              <goal>start-server</goal>
                           </goals>
                           <configuration>
                              <background>true</background>
                              <port>${selenium.server.port}</port>
                              <logOutput>true</logOutput>
                              <logFile>${selenium.log.dir}/selenium-server.log</logFile>
                              <browserSideLog>${selenium.debug}</browserSideLog>
                              <debug>${selenium.debug}</debug>
                           </configuration>
                        </execution>
                     </executions>
                  </plugin>
                  
                  <!-- run functional tests -->
                  <plugin>
                     <groupId>org.codehaus.mojo</groupId>
                     <artifactId>failsafe-maven-plugin</artifactId>
                     <configuration>
                        <suiteXmlFiles>
                           <suiteXmlFile>${ftest.resources.directory}/${ftest.suite.xml}</suiteXmlFile>
                        </suiteXmlFiles>
                        <argLine>-Xmx748m</argLine>
                        <forkMode>once</forkMode>
                        <systemProperties>
                           <property>
                              <name>method</name>
                              <value>${method}</value>
                           </property>
                           <property>
                              <name>browser</name>
                              <value>${selenium.browser}</value>
                           </property>
                           <property>
                              <name>context.root</name>
                              <value>${context.root}</value>
                           </property>
                           <property>
                              <name>context.path</name>
                              <value>${context.path}</value>
                           </property>
                           <property>
                              <name>selenium.host</name>
                              <value>${selenium.server.host}</value>
                           </property>
                           <property>
                              <name>selenium.port</name>
                              <value>${selenium.server.port}</value>
                           </property>
                           <property>
                              <name>selenium.debug</name>
                              <value>${selenium.debug}</value>
                           </property>
                           <property>
                              <name>selenium.maximize</name>
                              <value>${selenium.maximize}</value>
                           </property>
                           <property>
                              <name>maven.resources.dir</name>
                              <value>${resources.dir}</value>
                           </property>
                           <property>
                              <name>maven.project.build.directory</name>
                              <value>${project.build.directory}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.default</name>
                              <value>${selenium.timeout.default}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.gui</name>
                              <value>${selenium.timeout.gui}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.ajax</name>
                              <value>${selenium.timeout.ajax}</value>
                           </property>
                           <property>
                              <name>selenium.timeout.model</name>
                              <value>${selenium.timeout.model}</value>
                           </property>
                           <property>
                              <name>selenium.maximize</name>
                              <value>${selenium.maximize}</value>
                           </property>
                           <property>
                              <name>maven.resources.dir</name>
                              <value>${resources.dir}</value>
                           </property>
                           <property>
                              <name>maven.project.build.directory</name>
                              <value>${project.build.directory}</value>
                           </property>
                        </systemProperties>
                     </configuration>
                     <executions>
                        <execution>
                           <id>verify</id>
                           <phase>verify</phase>
                           <goals>
                              <goal>verify</goal>
                           </goals>
                        </execution>
                        <execution>
                           <id>integration-test</id>
                           <phase>integration-test</phase>
                           <goals>
                              <goal>integration-test</goal>
                           </goals>
                        </execution>
                     </executions>
                  </plugin>

                  <!-- stop Selenium -->
                  <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-antrun-plugin</artifactId>
                     <executions>
                        <execution>
                           <!-- this ant script runs testng natively -->
                           <id>stop-selenium</id>
                           <phase>post-integration-test</phase>
                           <configuration>
                              <tasks>
                                 <echo taskname="selenium-shutdown" message="DGF Errors during shutdown are expected" />
                                 <get taskname="selenium-shutdown" src="http://${selenium.server.host}:${selenium.server.port}/selenium-server/driver/?cmd=shutDownSeleniumServer" ignoreerrors="true" dest="${selenium.log.dir}/selenium.stop.msg" />
                              </tasks>
                           </configuration>
                           <goals>
                              <goal>run</goal>
                           </goals>
                        </execution>
                     </executions>
                  </plugin>
               </plugins>
            </pluginManagement>
         </build>
      </profile>
      <profile>
         <id>jboss-public-repository</id>
         <!-- Repository is active unless explicitly disabled e.g. -P!jboss-public-repository -->
         <activation>
            <property>
               <name>jboss-public-repository</name>
               <value>!false</value>
            </property>
         </activation>
         <repositories>
            <repository>
               <id>jboss-public-repository-group</id>
               <name>JBoss Public Maven Repository Group</name>
               <url>http://repository.jboss.org/nexus/content/groups/public</url>
               <layout>default</layout>
               <releases>
                  <enabled>true</enabled>
                  <updatePolicy>never</updatePolicy>
               </releases>
               <snapshots>
                  <enabled>false</enabled>
                  <updatePolicy>never</updatePolicy>
               </snapshots>
            </repository>
         </repositories>
         <pluginRepositories>
            <pluginRepository>
               <id>jboss-public-repository-group</id>
               <name>JBoss Public Maven Repository Group</name>
               <url>http://repository.jboss.org/nexus/content/groups/public</url>
               <layout>default</layout>
               <releases>
                  <enabled>true</enabled>
                  <updatePolicy>never</updatePolicy>
               </releases>
               <snapshots>
                  <enabled>true</enabled>
                  <updatePolicy>never</updatePolicy>
               </snapshots>
            </pluginRepository>
         </pluginRepositories>
      </profile>
   </profiles>
</project>
