<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.gatein.pc</groupId>
      <artifactId>pc-test-servers</artifactId>
      <version>2.3.0-Alpha01</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>pc-test-tomcat6</artifactId>
   <packaging>jar</packaging>
   <name>GateIn - Portlet Container (test - servers - Tomcat 6)</name>

   <dependencies>

      <dependency>
         <groupId>org.gatein.common</groupId>
         <artifactId>common-logging</artifactId>
      </dependency>

      <dependency>
         <groupId>org.gatein.wci</groupId>
         <artifactId>wci-wci</artifactId>
      </dependency>

      <dependency>
         <groupId>org.gatein.pc</groupId>
         <artifactId>pc-controller</artifactId>
      </dependency>
      <dependency>
         <groupId>org.gatein.pc</groupId>
         <artifactId>pc-portlet</artifactId>
      </dependency>
      <dependency>
         <groupId>org.gatein.pc</groupId>
         <artifactId>pc-mc</artifactId>
      </dependency>
      <dependency>
         <groupId>org.gatein.pc</groupId>
         <artifactId>pc-api</artifactId>
      </dependency>

      <dependency>
         <groupId>apache-log4j</groupId>
         <artifactId>log4j</artifactId>
      </dependency>

      <dependency>
         <groupId>org.jboss.unit</groupId>
         <artifactId>jboss-unit</artifactId>
         <exclusions>
            <exclusion>
               <groupId>cargo</groupId>
               <artifactId>core</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.jboss.unit</groupId>
         <artifactId>jboss-unit-remote</artifactId>
         <exclusions>
            <exclusion>
               <groupId>cargo</groupId>
               <artifactId>core</artifactId>
            </exclusion>
         </exclusions>
      </dependency>
      <dependency>
         <groupId>org.jboss.unit</groupId>
         <artifactId>jboss-unit-tooling-ant</artifactId>
      </dependency>
      <dependency>
         <groupId>org.jboss.unit</groupId>
         <artifactId>portal-test</artifactId>
      </dependency>
      <dependency>
         <groupId>org.jboss.unit</groupId>
         <artifactId>portal-test-generic</artifactId>
      </dependency>

      <dependency>
         <groupId>org.jboss.remoting</groupId>
         <artifactId>jboss-remoting</artifactId>
      </dependency>

      <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-simple</artifactId>
      </dependency>

      <dependency>
         <groupId>concurrent</groupId>
         <artifactId>concurrent</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>jboss</groupId>
         <artifactId>jboss-serialization</artifactId>
         <scope>test</scope>
      </dependency>

      <dependency>
         <groupId>jboss</groupId>
         <artifactId>jboss-common-logging-jdk</artifactId>
      </dependency>
      <dependency>
         <groupId>jboss</groupId>
         <artifactId>jboss-common-logging-log4j</artifactId>
      </dependency>

      <dependency>
         <groupId>commons-logging</groupId>
         <artifactId>commons-logging</artifactId>
      </dependency>
      <dependency>
         <groupId>commons-httpclient</groupId>
         <artifactId>commons-httpclient</artifactId>
      </dependency>

      <dependency>
         <groupId>javax.ccpp</groupId>
         <artifactId>ccpp</artifactId>
      </dependency>
      <dependency>
         <groupId>javax.portlet</groupId>
         <artifactId>portlet-api</artifactId>
      </dependency>

      <dependency>
         <groupId>org.gatein.pc</groupId>
         <artifactId>pc-test-core</artifactId>
         <scope>test</scope>
      </dependency>

      <dependency>
         <groupId>org.gatein.pc</groupId>
         <artifactId>pc-test-core</artifactId>
         <version>2.3.0-Alpha01</version>
         <type>test-jar</type>
         <scope>test</scope>
      </dependency>

      <!-- JSTL for Tomcat -->
      <dependency>
         <groupId>apache-taglibs</groupId>
         <artifactId>jstl</artifactId>
      </dependency>
      <dependency>
         <groupId>apache-taglibs</groupId>
         <artifactId>standard</artifactId>
      </dependency>


      <dependency>
         <groupId>org.gatein.wci</groupId>
         <artifactId>wci-tomcat6</artifactId>
      </dependency>

      <dependency>
         <groupId>commons-discovery</groupId>
         <artifactId>commons-discovery</artifactId>
      </dependency>

      <dependency>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-core-uberjar</artifactId>
        <version>${version.cargo}</version>
        <scope>test</scope>
      </dependency>

     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-ant-tasks</artifactId>
       <version>2.1.1</version>
     </dependency>

   </dependencies>

   <profiles>
      <!--By default Annotation Processing Tool related classes need to be disabled-->
      <profile>
         <id>default</id>
         <activation>
            <activeByDefault>true</activeByDefault>
         </activation>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-compiler-plugin</artifactId>
                  <executions>
                     <execution>
                        <goals>
                           <goal>compile</goal>
                        </goals>
                     </execution>
                  </executions>
                  <configuration>
                     <excludes>
                        <exclude>org/gatein/pc/test/unit/reports/*</exclude>
                     </excludes>
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </profile>

      <profile>
         <id>apt</id>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.myfaces.tobago</groupId>
                  <artifactId>maven-apt-plugin</artifactId>
                  <executions>
                     <execution>
                        <phase>package</phase>
                        <configuration>
                           <factory>org.gatein.pc.test.unit.reports.TestCaseAPF</factory>
                           <force>true</force>
                           <target>1.5</target>
                           <nocompile>true</nocompile>
                           <showWarnings>true</showWarnings>
                        </configuration>
                        <goals>
                           <goal>testExecute</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
         <dependencies>
            <dependency>
               <groupId>sun.jdk</groupId>
               <artifactId>tools</artifactId>
               <version>1.5.0</version>
               <scope>system</scope>
               <systemPath>${java.home}/../lib/tools.jar</systemPath>
            </dependency>
         </dependencies>
      </profile>
      <!--On MacOSX the tools.jar should be already in the classpath-->
      <profile>
         <id>apt-mac</id>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.myfaces.tobago</groupId>
                  <artifactId>maven-apt-plugin</artifactId>
                  <executions>
                     <execution>
                        <phase>package</phase>
                        <configuration>
                           <factory>org.gatein.pc.test.unit.reports.TestCaseAPF</factory>
                           <force>true</force>
                           <target>1.5</target>
                           <nocompile>true</nocompile>
                           <showWarnings>true</showWarnings>
                        </configuration>
                        <goals>
                           <goal>testExecute</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>
      <profile>
         <id>cargo.debug</id>
         <properties>
            <test.cargo.debug>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000</test.cargo.debug>
         </properties>
      </profile>
   </profiles>

   <build>
      <plugins>
         <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
               <execution>
                  <id>copy-common-build.xml</id>
                  <phase>process-resources</phase>
                  <goals>
                     <goal>copy</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.5</version>

            <dependencies>

               <dependency>
                  <groupId>org.jboss.unit</groupId>
                  <artifactId>jboss-unit-tooling-ant</artifactId>
                  <version>${version.jboss.unit}</version>
               </dependency>
               <dependency>
                  <groupId>org.jboss.unit</groupId>
                  <artifactId>jboss-unit</artifactId>
                  <version>${version.jboss.unit}</version>
               </dependency>

               <dependency>
                  <groupId>org.codehaus.cargo</groupId>
                  <artifactId>cargo-ant</artifactId>
                  <version>${version.cargo}</version>
                  <exclusions>
                     <exclusion>
                        <groupId>ant</groupId>
                        <artifactId>ant</artifactId>
                     </exclusion>
                  </exclusions>
               </dependency>
               <dependency>
                 <groupId>org.jdom</groupId>
                 <artifactId>jdom</artifactId>
                 <version>1.1</version>
               </dependency>
               <dependency>
                 <groupId>dom4j</groupId>
                 <artifactId>dom4j</artifactId>
                 <version>1.6.1</version>
               </dependency>
               <dependency>
                 <groupId>jaxen</groupId>
                 <artifactId>jaxen</artifactId>
                 <version>1.1.1</version>
               </dependency>
            </dependencies>
            <executions>
               <execution>
                  <id>test</id>
                  <phase>test</phase>
                  <configuration>
                     <tasks>

                        <property name="compile_classpath" refid="maven.compile.classpath" />
                        <property name="runtime_classpath" refid="maven.runtime.classpath" />
                        <property name="test_classpath" refid="maven.test.classpath" />
                        <property name="plugin_classpath" refid="maven.plugin.classpath" />
                        <property name="project.version" value="${project.version}" />
                        <property name="basedir" value="${basedir}" />

                        <condition property="cargo.debug" value="${test.cargo.debug}">
                           <isset property="test.cargo.debug" />
                        </condition>
                        <condition property="cargo.debug" value="">
                          <not>
                            <isset property="test.cargo.debug" />
                          </not>
                        </condition>

                        <!-- location of common.xml shared between the different server's build.xml -->
                        <!-- for now hardcode like that, it should be probably moved to the test-core package -->
                        <property name="common.xml.file" value="${project.basedir}/../src/common/resources/common.xml" />

                        <ant antfile="${basedir}/src/test/build.xml" inheritRefs="true">
                           <target name="tests" />
                        </ant>

                     </tasks>
                  </configuration>
                  <goals>
                     <goal>run</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
      </plugins>

   </build>
</project>