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

    <groupId>org.jboss.seam</groupId>
    <artifactId>examples</artifactId>
    <version>2.3.0.Final</version>
    <packaging>pom</packaging>

    <name>Seam 2 EE 6 examples</name>
    <description>Examples for Seam 2 Framework in Java EE6 environment</description>
    <url>http://seamframework.org/Seam2</url>
    
    <licenses>
        <license>
            <name>LGPL</name>
            <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>JBoss Seam committers</name>
        </developer>
    </developers>

    <mailingLists>
        <mailingList>
            <archive>http://lists.jboss.org/pipermail/seam-dev/</archive>
            <name>Seam Developer List</name>
        </mailingList>
    </mailingLists>

    <scm>
        <connection>scm:svn:https://svn.jboss.org/repos/seam/branches/enterprise/WFK-2_0</connection>
        <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/branches/enterprise/WFK-2_0</developerConnection>
        <url>scm:svn:https://svn.jboss.org/repos/seam/branches/enterprise/WFK-2_0</url>
    </scm>

    <organization>
        <name>Seam Framework</name>
        <url>http://seamframework.org</url>
    </organization>        
    
    <properties>
        <version.org.hibernate.search>4.2.0.Beta1</version.org.hibernate.search>

        <!-- Excluded TestNG groups (ex: slow annotated tests won't run during 
            the test phase) -->
        <tests.excludedGroups>slow</tests.excludedGroups>
        <guava.version>12.0</guava.version>
        <richfaces.version>4.2.2.Final</richfaces.version>
        <slf4j.version>1.6.1</slf4j.version>
        <version.jbossas7>7.1.1.Final</version.jbossas7>

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

        <!-- ************** -->
        <!-- Build settings -->
        <!-- ************** -->
    
        <!-- Cross plugins settings -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    
        <!-- maven-compiler-plugin -->
        <maven.compiler.target>1.6</maven.compiler.target>
        <maven.compiler.source>1.6</maven.compiler.source>
    
        <!--
            Options to override the compiler arguments directly on the compiler arument line to separate between what
            the IDE understands as the source level and what the Maven compiler actually use.
        -->
        <maven.compiler.argument.target>${maven.compiler.target}</maven.compiler.argument.target>
        <maven.compiler.argument.source>${maven.compiler.source}</maven.compiler.argument.source>
        
    </properties>
    
    <modules>
        <module>blog</module>
        <module>booking</module>
        <module>contactlist</module>
        <module>drools</module>
        <module>dvdstore</module>
        <module>excel</module>
        <module>groovybooking</module>
        <module>guice</module>
        <module>hibernate</module>
        <module>icefaces</module>
        <module>itext</module>
        <module>jee6</module>
        <module>jpa</module>
        <module>mail</module>
        <module>messages</module>
        <module>metawidget/booking</module>
        <module>metawidget/groovybooking</module>
        <module>nestedbooking</module>
        <module>numberguess</module>
        <module>openid</module>
        <module>quartz</module>
        <module>registration</module>
        <module>remoting/chatroom</module>
        <module>remoting/gwt</module>
        <module>remoting/helloworld</module>
        <module>restbay</module>
        <module>rss</module>
        <module>seambay</module>
        <module>seamdiscs</module>
        <module>seampay</module>
        <module>seamspace</module>
        <module>spring</module>
        <module>tasks</module>
        <module>todo</module>
        <module>ui</module>
        <module>wicket</module>
    </modules>

    <build>
        <defaultGoal>package</defaultGoal>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.12</version>
                    <configuration>
                        <excludedGroups>${tests.excludedGroups}</excludedGroups>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-ear-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
                
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.7</version>
                </plugin>
                
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.5</version>
                </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>
                <plugin>
                    <groupId>org.jboss.as.plugins</groupId>
                    <artifactId>jboss-as-maven-plugin</artifactId>
                    <version>7.1.1.Final</version>
                    <executions>
                        <execution>
                            <phase></phase>
                            <goals>
                                <goal>deploy</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-ejb-plugin</artifactId>
                    <version>2.3</version>
                    <configuration>
                        <ejbVersion>3.0</ejbVersion>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1.1</version>
                    <inherited>true</inherited>
                    <configuration>
                        <failOnMissingWebXml>false</failOnMissingWebXml>
                        <warName>${project.build.finalName}</warName>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jboss.seam</groupId>
                <artifactId>bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.richfaces</groupId>
                <artifactId>richfaces-bom</artifactId>
                <version>${richfaces.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- 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>org.richfaces.ui</groupId>
                <artifactId>richfaces-components-ui</artifactId>
                <version>${richfaces.version}</version>
            </dependency>
            <dependency>
                <groupId>org.richfaces.core</groupId>
                <artifactId>richfaces-core-impl</artifactId>
                <version>${richfaces.version}</version>
            </dependency>

            <!-- guava is required by richfaces -->

            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>


            <!--  common test scope dependencies -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j.version}</version>
            </dependency>


            <!-- <dependency>
                <groupId>org.metawidget</groupId>
                <artifactId>metawidget-backend</artifactId>
                <version>0.95</version>
            </dependency>
            
            <dependency>
                <groupId>org.metawidget</groupId>
                <artifactId>metawidget-frontend</artifactId>
                <version>0.95</version>
            </dependency>
            
            <dependency>
                <groupId>org.metawidget</groupId>
                <artifactId>metawidget</artifactId>
                <version>0.95</version>
            </dependency>-->

            <dependency>
                <groupId>org.apache.myfaces.trinidad</groupId>
                <artifactId>trinidad-api</artifactId>
                <version>2.0.1</version>
            </dependency>

            <dependency>
                <groupId>org.apache.myfaces.trinidad</groupId>
                <artifactId>trinidad-impl</artifactId>
                <version>2.0.1</version>
            </dependency>

            <!-- Hibernate search version override due to JBSEAM-4984 -->
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-search</artifactId>
                <version>${version.org.hibernate.search}</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-search-analyzers</artifactId>
                <version>${version.org.hibernate.search}</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-search-engine</artifactId>
                <version>${version.org.hibernate.search}</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-search-infinispan</artifactId>
                <version>${version.org.hibernate.search}</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-search-orm</artifactId>
                <version>${version.org.hibernate.search}</version>
            </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>
                                            <exclude>**/webdriver/*</exclude>
                                            <exclude>**/xml/*</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</groupId>
                    <artifactId>selenium-server</artifactId>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-java</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>2.3</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-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>
        <profile>
            <id>validate</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>xml-maven-plugin</artifactId>
                        <version>1.0</version>
                        <configuration>
<!--                            <catalogs> -->
<!--                                 <catalog>src/main/resources/org/jboss/seam/catalog.xml</catalog> -->
<!--                             </catalogs> -->
                            <validationSets>
                                <validationSet>
                                    <dir>src/test/resources/WEB-INF/</dir>
                                    <includes>
                                        <include>components.xml</include>
                                        <include>ejb-jar.xml</include>
                                        <include>faces-config.xml</include>
                                    </includes>
                                    <validating>true</validating>
                                </validationSet>
                                <validationSet>
                                    <dir>src/test/resources/META-INF/</dir>
                                    <includes>
                                        <include>persistence.xml</include>
                                    </includes>
                                    <validating>true</validating>
                                </validationSet>
                            </validationSets>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>          
    </profiles>

</project>

