<?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</artifactId>
    <version>1.0.0.Beta3</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <packaging>pom</packaging>
  <artifactId>jboss-jsfunit-examples</artifactId>
  <name>JSFUnit Examples</name>    

  <modules>
    <module>jboss-jsfunit-examples-hellojsf</module>
    <module>jboss-jsfunit-examples-ajax4jsf</module>
    <module>jboss-jsfunit-examples-richfaces</module>
    <module>jboss-jsfunit-examples-seam</module>
  </modules>
    
  <pluginRepositories>
     <pluginRepository>
       <id>codehaus snapshot repository</id>
       <url>http://snapshots.repository.codehaus.org/</url>
       <releases>
         <enabled>true</enabled>
       </releases>
     </pluginRepository>
   </pluginRepositories>

  <profiles>
    
    <profile>
      <id>tomcat5x</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <configuration>
              <container>
                <containerId>tomcat5x</containerId>
                <home>${CATALINA_HOME}</home>
                <log>${basedir}/target/tomcat5x/cargo.log</log>
                <output>${basedir}/target/tomcat5x/container.log</output>
              </container>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    
    <profile>
      <id>tomcat6x</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <configuration>
              <container>
                <containerId>tomcat6x</containerId>
                <home>${CATALINA_HOME}</home>
                <log>${basedir}/target/tomcat6x/cargo.log</log>
                <output>${basedir}/target/tomcat6x/container.log</output>
              </container>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>jboss4.0</id>    
      <dependencies>
         <dependency>
           <groupId>org.apache.myfaces.core</groupId>
           <artifactId>myfaces-api</artifactId>
           <scope>provided</scope>
         </dependency>
       </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <configuration>
              <wait>false</wait>
              <container>
                <containerId>jboss4x</containerId>
                <home>${JBOSS_HOME}</home>
                <log>${basedir}/target/jboss4.0/cargo.log</log>
                <output>${basedir}/target/jboss4.0/container.log</output>
              </container>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    
    <profile>
      <id>jboss4.2</id>    
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <configuration>
              <wait>false</wait>
              <container>
                <containerId>jboss42x</containerId>
                <home>${JBOSS_HOME}</home>
                <log>${basedir}/target/jboss4.2/cargo.log</log>
                <output>${basedir}/target/jboss4.2/container.log</output>
              </container>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    
    <profile>
      <id>jboss5x</id>  
      <dependencies>
        <dependency>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
          <version>1.3</version>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>xalan</groupId>
          <artifactId>xalan</artifactId>
          <scope>provided</scope>
        </dependency>
        <dependency>
           <groupId>xerces</groupId>
           <artifactId>xercesImpl</artifactId>
           <scope>provided</scope>
           <version>2.8.1</version>
        </dependency>
        <dependency>
           <groupId>httpunit</groupId>
           <artifactId>httpunit</artifactId>
           <scope>compile</scope>
           <exclusions>
              <exclusion>
                 <groupId>jtidy</groupId>
                 <artifactId>jtidy</artifactId>
              </exclusion>
              <exclusion>
                 <groupId>javax.servlet</groupId>
                 <artifactId>servlet-api</artifactId>
              </exclusion>
           </exclusions>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <configuration>
              <wait>false</wait>
              <container>
                <containerId>jboss5x</containerId>
                <home>${JBOSS_HOME}</home>
                <log>${basedir}/target/jboss5.x/cargo.log</log>
                <output>${basedir}/target/jboss5.x/container.log</output>
              </container>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
         <jsfunit.htmlparser>NEKO</jsfunit.htmlparser>
      </properties>
    </profile>
    
    <profile>
      <id>jee5</id>
      <dependencies>
        <dependency>
          <groupId>javax.faces</groupId>
          <artifactId>jsf-api</artifactId>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>javax.el</groupId>
          <artifactId>el-api</artifactId>
          <scope>provided</scope>
        </dependency>    
      </dependencies>
    </profile>    
    
    <profile>
       <id>myfaces1.1</id>
       <dependencies>
         <dependency>
           <groupId>org.apache.myfaces.core</groupId>
           <artifactId>myfaces-impl</artifactId>
           <scope>compile</scope>
         </dependency>

         <dependency>
           <groupId>org.apache.myfaces.core</groupId>
           <artifactId>myfaces-api</artifactId>
           <scope>compile</scope>
         </dependency>
       </dependencies>
       <activation>
         <property>
           <name>jsfunit-test-profile</name>
         </property>
       </activation>
    </profile>
    
    <profile>
       <id>mojarra1.2</id>
       <dependencies>
         <dependency>
           <groupId>javax.faces</groupId>
           <artifactId>jsf-api</artifactId>
           <scope>compile</scope>
         </dependency>

         <dependency>
           <groupId>javax.faces</groupId>
           <artifactId>jsf-impl</artifactId>
           <scope>compile</scope>
         </dependency>
         
         <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
         </dependency>
       </dependencies>
    </profile>
    
  </profiles>
  
  <build>
    <plugins>
       
      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <!-- <version>1.0-SNAPSHOT</version> -->
        <version>1.0-alpha-5</version>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <warName>${artifactId}</warName>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
