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

    <parent>
        <groupId>org.jboss.seam</groupId>
        <artifactId>jboss-seam-parent</artifactId>
        <version>2.3.0-SNAPSHOT</version>
        <relativePath>../jboss-seam-parent/pom.xml</relativePath>
    </parent>

    <groupId>org.jboss.seam</groupId>
    <artifactId>examples-ee6</artifactId>
    <packaging>pom</packaging>

    <name>Seam 2 EE 6 examples</name>
    <description>Examples for Seam 2 Framework in Java EE6 enviroment</description>

    <modules>
        <module>booking</module>
        <module>mail</module>
        <module>messages</module>
    </modules>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <excludedGroups>${tests.excludedGroups}</excludedGroups>
                    </configuration>
                </plugin>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
		        <plugin>
		            <groupId>org.eclipse.m2e</groupId>
		            <artifactId>lifecycle-mapping</artifactId>
		            <version>1.0.0</version>
		            <configuration>
		                <lifecycleMappingMetadata>
		                    <pluginExecutions>
		                        <pluginExecution>
		                            <pluginExecutionFilter>
		                                <groupId>org.apache.maven.plugins</groupId>
		                                <artifactId>maven-dependency-plugin</artifactId>
		                                <versionRange>[1.0,)</versionRange>
		                                <goals>
		                                    <goal>unpack</goal>
		                                </goals>
		                            </pluginExecutionFilter>
		                            <action>
		                                <execute><runOnIncremental>false</runOnIncremental></execute>
		                            </action>
		                        </pluginExecution>
		                    </pluginExecutions>
		                </lifecycleMappingMetadata>
		            </configuration>
		        </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencyManagement>
        <dependencies>
            <!-- common provided scope dependencies -->
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>1.1.1</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>3.2</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax.ejb</groupId>
                <artifactId>ejb-api</artifactId>
                <version>3.0</version>
                <type>jar</type>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.jboss.seam</groupId>
                <artifactId>jboss-seam-jsf2</artifactId>
                <version>${project.version}</version>
                <type>ejb</type>
                <scope>provided</scope>
                <exclusions>
                    <exclusion>
                        <groupId>jboss</groupId>
                        <artifactId>javassist</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-api</artifactId>
                <version>${version.jsf2}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.sun.faces</groupId>
                <artifactId>jsf-impl</artifactId>
                <version>${version.jsf2}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax.mail</groupId>
                <artifactId>mail</artifactId>
                <version>1.4.2</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax</groupId>
                <artifactId>javaee-web-api</artifactId>
                <version>6.0</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>4.0.1.Final</version>
            </dependency>
            
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>4.2.0.Final</version>
            </dependency>          
              
            <!-- common test scope dependencies -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>distribution</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>distribution</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                                <configuration>
                                    <descriptorRefs>
                                        <descriptorRef>project</descriptorRef>
                                    </descriptorRefs>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>               
                </plugins>               
            </build>
        </profile>

        <profile>
            <id>integration-tests</id>
            <activation>
                <property>
                    <name>arquillian</name>
                </property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <configuration>
                                <skip>true</skip>
                            </configuration>
                            <executions>
                                <execution>
                                    <id>integration-test</id>
                                    <phase>integration-test</phase>
                                    <goals>
                                        <goal>test</goal>
                                    </goals>
                                    <configuration>
                                        <skip>false</skip>
                                        <!-- Needed as we have both junit and testng -->
                                        <testNGArtifactName>none:none</testNGArtifactName>
                                        <!-- exclude selenium tests -->
                                        <excludes>
                                            <exclude>**/selenium/*</exclude>
                                        </excludes>
                                        <systemProperties>
                                            <!-- used by the jbossas-managed-7 profile in arquillian.xml for the jbossHome property-->
                                            <version.jbossas7>${version.jbossas7}</version.jbossas7>
                                        </systemProperties>
                                    </configuration>
                                </execution> 
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>

        <profile>
            <id>arq-jbossas-7-managed</id>
            <activation>
                <property>
                    <name>arquillian</name>
                    <value>jbossas-managed-7</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.as</groupId>
                    <artifactId>jboss-as-arquillian-container-managed</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack-as7</id>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.jboss.as</groupId>
                                            <artifactId>jboss-as-dist</artifactId>
                                            <version>${version.jbossas7}</version>
                                            <type>zip</type>
                                            <overWrite>false</overWrite>
                                            <outputDirectory>${project.build.directory}</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
                </pluginManagement>
            </build>
       </profile>

        <profile>
            <id>arq-jbossas-7-remote</id>
            <activation>
                <property>
                    <name>arquillian</name>
                    <value>jbossas-remote-7</value>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.as</groupId>
                    <artifactId>jboss-as-arquillian-container-remote</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>ftest-jbossas</id>
            <properties>
                <testng.suite>testng.xml</testng.suite>
                <container>jbossas7</container>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.seleniumhq.selenium.server</groupId>
                    <artifactId>selenium-server</artifactId>
                    <classifier>standalone</classifier>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.seleniumhq.selenium.client-drivers</groupId>
                    <artifactId>selenium-java-client-driver</artifactId>
                    <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>selenium-maven-plugin</artifactId>
                            <version>1.1</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>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>failsafe-maven-plugin</artifactId>
                            <version>2.4.3-alpha-1</version>
                            <configuration>
                                <junitArtifactName>none:node</junitArtifactName> 
                                <suiteXmlFiles>
                                    <suiteXmlFile>${ftest.resources.dir}/${testng.suite}</suiteXmlFile>
                                </suiteXmlFiles>
                                <argLine>-Xmx748m</argLine>
                                <forkMode>once</forkMode>
                                <properties>
                                    <property>
                                        <name>listener</name>
                                        <value>org.jboss.seam.example.common.test.selenium.SeleniumFunctionalTestListener</value>
                                    </property>
                                </properties>
                                <systemProperties>
                                    <property>
                                        <name>selenium.browser</name>
                                        <value>${selenium.browser}</value>
                                    </property>
                                    <property>
                                        <name>selenium.browser.url</name>
                                        <value>${selenium.browser.url}</value>
                                    </property>
                                    <property>
                                        <name>example.context.path</name>
                                        <value>${example.context.path}</value>
                                    </property>
                                    <property>
                                        <name>selenium.host</name>
                                        <value>${selenium.server.host}</value>
                                    </property>
                                    <property>
                                        <name>selenium.server.port</name>
                                        <value>${selenium.server.port}</value>
                                    </property>
                                    <property>
                                        <name>selenium.speed</name>
                                        <value>${selenium.speed}</value>
                                    </property>
                                    <property>
                                        <name>selenium.timeout</name>
                                        <value>${selenium.timeout}</value>
                                    </property>
                                    <property>
                                        <name>selenium.output.dir</name>
                                        <value>${selenium.output.dir}</value>
                                    </property>
                                    <property>
                                        <name>jboss.home</name>
                                        <value>${jboss.home}</value>
                                    </property>
                                    <property>
                                        <name>container</name>
                                        <value>${container}</value>
                                    </property>
                                    <property>
                                        <name>openid.account</name>
                                        <value>${openid.account}</value>
                                    </property>
                                    <property>
                                        <name>openid.password</name>
                                        <value>${openid.password}</value>
                                    </property>
                                    <property>
                                        <name>xml.namespace.aware</name>
                                        <value>${xml.namespace.aware}</value>
                                    </property>
                                    <!-- WebDriver specific properties -->
                                    <property>
                                        <name>browser</name>
                                        <value>${selenium.browser}</value>
                                    </property>
                                    <property>
                                        <name>server.url</name>
                                        <value>${selenium.browser.url}</value>
                                    </property>
                                    <property>
                                        <name>context.path</name>
                                        <value>${example.context.path}</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>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-antrun-plugin</artifactId>
                            <executions>
                                <execution>
                                    <!-- this ant script runs testng natively -->
                                    <id>wait-for-application</id>
                                    <phase>pre-integration-test</phase>
                                    <configuration>
                                        <tasks>
                                            <echo message="Waiting for ${selenium.browser.url}/${example.context.path}" />
                                            <waitfor maxwait="1" maxwaitunit="minute" checkevery="5000">
                                                <http url="${selenium.browser.url}/${example.context.path}" errorsBeginAt="404" />
                                            </waitfor>
                                        </tasks>
                                    </configuration>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                </execution>
                                <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>
                                <execution>
                                    <!-- undeploy the example now in the event of being a directory (exploded) -->
                                    <id>undeploy-exploded</id>
                                    <phase>post-integration-test</phase>
                                    <configuration>
                                        <tasks>
                                            <delete dir="${jboss.home}/server/${jboss.domain}/deploy/${example.context.path}.war" failonerror="false" />
                                        </tasks>
                                    </configuration>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>ftest-tomcat</id>
            <properties>
                <testng.suite>testng.xml</testng.suite>
                <container>jboss5</container>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.seleniumhq.selenium.server</groupId>
                    <artifactId>selenium-server</artifactId>
                    <classifier>standalone</classifier>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.seleniumhq.selenium.client-drivers</groupId>
                    <artifactId>selenium-java-client-driver</artifactId>
                    <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>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>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>failsafe-maven-plugin</artifactId>
                            <configuration>
                                <suiteXmlFiles>
                                    <suiteXmlFile>${ftest.resources.dir}/${testng.suite}</suiteXmlFile>
                                </suiteXmlFiles>
                                <argLine>-Xmx748m</argLine>
                                <forkMode>once</forkMode>
                                <properties>
                                    <property>
                                        <name>listener</name>
                                        <value>org.jboss.seam.example.common.test.selenium.SeleniumFunctionalTestListener</value>
                                    </property>
                                </properties>
                                <systemProperties>
                                    <property>
                                        <name>selenium.browser</name>
                                        <value>${selenium.browser}</value>
                                    </property>
                                    <property>
                                        <name>selenium.browser.url</name>
                                        <value>${selenium.browser.url}</value>
                                    </property>
                                    <property>
                                        <name>example.context.path</name>
                                        <value>${example.context.path}</value>
                                    </property>
                                    <property>
                                        <name>selenium.host</name>
                                        <value>${selenium.server.host}</value>
                                    </property>
                                    <property>
                                        <name>selenium.server.port</name>
                                        <value>${selenium.server.port}</value>
                                    </property>
                                    <property>
                                        <name>selenium.speed</name>
                                        <value>${selenium.speed}</value>
                                    </property>
                                    <property>
                                        <name>selenium.timeout</name>
                                        <value>${selenium.timeout}</value>
                                    </property>
                                    <property>
                                        <name>selenium.output.dir</name>
                                        <value>${selenium.output.dir}</value>
                                    </property>
                                    <property>
                                        <name>jboss.home</name>
                                        <value>${jboss.home}</value>
                                    </property>
                                    <property>
                                        <name>container</name>
                                        <value>${container}</value>
                                    </property>
                                    <property>
                                        <name>openid.account</name>
                                        <value>${openid.account}</value>
                                    </property>
                                    <property>
                                        <name>openid.password</name>
                                        <value>${openid.password}</value>
                                    </property>
                                    <!-- WebDriver specific properties -->
                                    <property>
                                        <name>browser</name>
                                        <value>${selenium.browser}</value>
                                    </property>
                                    <property>
                                        <name>server.url</name>
                                        <value>${selenium.browser.url}</value>
                                    </property>
                                    <property>
                                        <name>context.path</name>
                                        <value>${example.context.path}</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>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-antrun-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>deploy-application</id>
                                    <phase>pre-integration-test</phase>
                                    <configuration>
                                        <tasks>
                                            <fail unless="catalina.home" message="CATALINA_HOME environment property was not set" />
                                            <copy file="${basedir}/../${example.name}-web/target/${example.context.path}.war" todir="${catalina.home}/webapps" overwrite="true" />
                                        </tasks>
                                    </configuration>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                </execution>
                                <execution>
                                    <id>wait-for-application</id>
                                    <phase>pre-integration-test</phase>
                                    <configuration>
                                        <tasks>
                                            <echo message="Waiting for ${selenium.browser.url}/${example.context.path}" />
                                            <waitfor maxwait="1" maxwaitunit="minute" checkevery="5000">
                                                <http url="${selenium.browser.url}/${example.context.path}" errorsBeginAt="404" />
                                            </waitfor>
                                        </tasks>
                                    </configuration>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                </execution>
                                <execution>
                                    <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>
                                <execution>
                                    <id>undeploy-application</id>
                                    <phase>post-integration-test</phase>
                                    <configuration>
                                        <tasks>
                                            <delete file="${catalina.home}/webapps/${example.context.path}.war" failonerror="false" />
                                            <delete dir="${catalina.home}/webapps/${example.context.path}" failonerror="false" />
                                        </tasks>
                                    </configuration>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>ftest-jbossas-cluster</id>
            <properties>
                <testng.suite>testng-cluster.xml</testng.suite>
                <container>jboss5</container>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.seleniumhq.selenium.server</groupId>
                    <artifactId>selenium-server</artifactId>
                    <classifier>standalone</classifier>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.seleniumhq.selenium.client-drivers</groupId>
                    <artifactId>selenium-java-client-driver</artifactId>
                    <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>selenium-maven-plugin</artifactId>
                            <version>1.1</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>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>failsafe-maven-plugin</artifactId>
                            <version>2.4.3-alpha-1</version>
                            <configuration>
                                <suiteXmlFiles>
                                    <suiteXmlFile>${ftest.resources.dir}/${testng.suite}</suiteXmlFile>
                                </suiteXmlFiles>
                                <argLine>-Xmx748m</argLine>
                                <forkMode>once</forkMode>
                                <properties>
                                    <property>
                                        <name>listener</name>
                                        <value>org.jboss.seam.example.common.test.selenium.SeleniumFunctionalTestListener</value>
                                    </property>
                                </properties>
                                <systemProperties>
                                    <property>
                                        <name>selenium.browser</name>
                                        <value>${selenium.browser}</value>
                                    </property>
                                    <property>
                                        <name>selenium.browser.url</name>
                                        <value>${selenium.browser.url}</value>
                                    </property>
                                    <property>
                                        <name>example.context.path</name>
                                        <value>${example.context.path}</value>
                                    </property>
                                    <property>
                                        <name>selenium.host</name>
                                        <value>${selenium.server.host}</value>
                                    </property>
                                    <property>
                                        <name>selenium.server.port</name>
                                        <value>${selenium.server.port}</value>
                                    </property>
                                    <property>
                                        <name>selenium.speed</name>
                                        <value>${selenium.speed}</value>
                                    </property>
                                    <property>
                                        <name>selenium.timeout</name>
                                        <value>${selenium.timeout}</value>
                                    </property>
                                    <property>
                                        <name>selenium.output.dir</name>
                                        <value>${selenium.output.dir}</value>
                                    </property>
                                    <property>
                                        <name>jboss.home</name>
                                        <value>${jboss.home}</value>
                                    </property>
                                    <property>
                                        <name>container</name>
                                        <value>${container}</value>
                                    </property>
                                    <property>
                                        <name>openid.account</name>
                                        <value>${openid.account}</value>
                                    </property>
                                    <property>
                                        <name>openid.password</name>
                                        <value>${openid.password}</value>
                                    </property>
                                    <property>
                                        <name>xml.namespace.aware</name>
                                        <value>${xml.namespace.aware}</value>
                                    </property>
                                    <!-- WebDriver specific properties -->
                                    <property>
                                        <name>browser</name>
                                        <value>${selenium.browser}</value>
                                    </property>
                                    <property>
                                        <name>server.url</name>
                                        <value>${selenium.browser.url}</value>
                                    </property>
                                    <property>
                                        <name>context.path</name>
                                        <value>${example.context.path}</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>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-antrun-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>deploy-to-cluster</id>
                                    <phase>pre-integration-test</phase>
                                    <configuration>
                                        <tasks>
                                            <copy todir="${jboss.master.configuration}/farm" overwrite="true" flatten="true">
                                                <fileset dir="${basedir}/../${example.name}-ear/">
                                                    <include name="src/main/resources/jboss-seam-${example.name}-ds.xml" />
                                                    <include name="target/${example.context.path}.ear" />
                                                </fileset>
                                            </copy>
                                        </tasks>
                                    </configuration>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                </execution>
                                <execution>
                                    <!-- this ant script runs testng natively -->
                                    <id>wait-for-application</id>
                                    <phase>pre-integration-test</phase>
                                    <configuration>
                                        <tasks>
                                            <echo message="Waiting for ${selenium.browser.cluster.url}/${example.context.path}" />
                                            <waitfor maxwait="1" maxwaitunit="minute" checkevery="5000">
                                                <http url="${selenium.browser.cluster.url}/${example.context.path}" errorsBeginAt="404" />
                                            </waitfor>
                                        </tasks>
                                    </configuration>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                </execution>
                                <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>
                                <execution>
                                    <id>undeploy-from-cluster</id>
                                    <phase>post-integration-test</phase>
                                    <configuration>
                                        <tasks>
                                            <delete failonerror="false">
                                                <fileset dir="${jboss.master.configuration}/farm">
                                                    <include name="jboss-seam-${example.name}-ds.xml" />
                                                    <include name="${example.context.path}.ear" />
                                                </fileset>
                                            </delete>
                                        </tasks>
                                    </configuration>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>

    <properties>
        <!-- artifact versions -->
        <hibernate.version>3.3.2.GA</hibernate.version>
        <hibernate-em.version>3.4.0.GA</hibernate-em.version>
        <richfaces.version>4.1.0.Final</richfaces.version>
        <slf4j.version>1.5.8</slf4j.version>
        <java.version>1.5</java.version>
        <!-- Excluded TestNG groups (ex: slow annotated tests won't run during 
            the test phase) -->
        <tests.excludedGroups>slow</tests.excludedGroups>
        
        <!-- dependencies for functional tests -->
        <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.browser.cluster.url>http://localhost:8180</selenium.browser.cluster.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>
        <selenium.output.dir>${project.build.directory}/ftest-output</selenium.output.dir>
        <application.deploy.timeout>300</application.deploy.timeout>
        <browserSessionReuse>true</browserSessionReuse>
        <ftest.resources.dir>src/test/resources-ftest</ftest.resources.dir>
        <context.host>localhost</context.host>
        <example.context.path>/${project.build.finalName}/</example.context.path>
        <jboss.master.configuration>${env.JBOSS_HOME}/server/all</jboss.master.configuration>
        <jboss.home>${env.JBOSS_HOME}</jboss.home>
        <jboss.domain>default</jboss.domain>
        <catalina.home>${env.CATALINA_HOME}</catalina.home>
        <xml.namespace.aware>false</xml.namespace.aware>
    </properties>
</project>

