<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <parent>
    <groupId>org.jboss.jsfunit</groupId>
    <artifactId>jboss-jsfunit-examples</artifactId>
    <version>1.0-beta-1</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>jboss-jsfunit-examples-richfaces</artifactId>
  <packaging>war</packaging>  
  <name>Test RichFaces demo app</name>      
   
  <profiles>
    <profile>
      <id>test</id>        
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            
            <executions>
              <execution>
                <id>surefire-it</id>
                <phase>integration-test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <skip>false</skip>
                  <systemProperties>
                    <property>
                      <name>cactus.contextURL</name>
                      <value>http://localhost:8080/${artifactId}</value>
                    </property>
                  </systemProperties>
                </configuration>
              </execution>
            </executions>
          </plugin>
          
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <configuration>
              <wait>false</wait>  
              <configuration>                  
                <deployables>
                  <deployable>
                    <location>${project.build.directory}/${artifactId}.war</location>
                    <type>war</type>
                  </deployable>
                </deployables>
              </configuration>
            </configuration>
            <executions>
              <execution>
                <id>start-container</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>start</goal>
                </goals>
              </execution>
              <execution>
                <id>stop-container</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>stop</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>
      <activation>
        <property>
           <name>jsfunit-test-profile</name>
        </property>
      </activation>
    </profile>
    
    <profile>
      <id>jee5</id>
      <build>    
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.0.2</version>
            <configuration>
              <webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
              <warSourceExcludes>WEB-INF/lib/jsf-api*.jar,WEB-INF/lib/jsf-impl*.jar,WEB-INF/lib/jstl-*.jar,WEB-INF/lib/el-*.jar</warSourceExcludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>    
  </profiles>

  <dependencies>    
  
    <dependency>
      <groupId>org.jboss.jsfunit</groupId>
      <artifactId>jboss-jsfunit-core</artifactId>
      <version>${project.version}</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.jsfunit</groupId>
      <artifactId>jboss-jsfunit-richfaces</artifactId>
      <version>${project.version}</version>
      <scope>compile</scope>
    </dependency>
    
    <dependency>
      <groupId>org.richfaces.samples</groupId>
      <artifactId>richfaces-demo</artifactId>
      <version>3.1.1-GA</version>
      <type>war</type>
      <scope>runtime</scope>
    </dependency>
    
    <dependency>
      <groupId>org.richfaces.ui</groupId>
      <artifactId>richfaces-ui</artifactId>
      <version>3.1.1-GA</version>
      <scope>provided</scope>
    </dependency>
    
    <dependency>
      <groupId>org.richfaces.framework</groupId>
      <artifactId>richfaces-impl</artifactId>
      <version>3.1.1-GA</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.myfaces.core</groupId>
      <artifactId>myfaces-impl</artifactId>
      <scope>provided</scope>
    </dependency>
    
    <dependency>
      <groupId>org.apache.myfaces.core</groupId>
      <artifactId>myfaces-api</artifactId>
      <scope>provided</scope>
    </dependency>
        
    <dependency>
      <groupId>javax.el</groupId>
      <artifactId>el-api</artifactId>
      <version>1.0</version>
      <scope>compile</scope>
    </dependency>  

    <dependency>
      <groupId>com.sun.el</groupId>
      <artifactId>el-ri</artifactId>
      <version>1.0</version>
      <scope>compile</scope>
    </dependency> 
    
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>
    
  </dependencies>

  <!-- repo for el-ri -->
  <repositories>
    <repository>
      <id>java.net</id>
      <url>http://download.java.net/maven/2</url>
    </repository>
  </repositories>
  
  <build>
    <sourceDirectory>src/test/java</sourceDirectory>
    <testSourceDirectory>src/test/java</testSourceDirectory>
    
    <plugins>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <webResources>
            <resource>
              <directory>${basedir}/src/test/java/org/jboss/jsfunit/example/richfaces</directory>
              <targetPath>testsrc</targetPath>
              <includes>
                <include>*.java</include>
              </includes>
            </resource>
          </webResources>
        </configuration>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>  
  </build>

</project>
