<?xml version="1.0"?>
<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>
      <artifactId>jsr299-tck-parent</artifactId>
      <groupId>org.jboss.jsr299.tck</groupId>
      <version>1.0.0.BETA3</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.jboss.jsr299.tck</groupId>
   <artifactId>jsr299-tck-impl</artifactId>
   <name>JSR-299 TCK tests and harness</name>
   
   <dependencies>

      <dependency>
         <groupId>org.jboss.webbeans</groupId>
         <artifactId>jsr299-api</artifactId>
      </dependency>

      <dependency>
         <groupId>org.jboss.jsr299.tck</groupId>
         <artifactId>jsr299-tck-api</artifactId>
      </dependency>
      
      <dependency>
         <groupId>org.jboss.test-harness</groupId>
         <artifactId>jboss-test-harness</artifactId>
      </dependency>

      <dependency>
         <groupId>org.testng</groupId>
         <artifactId>testng</artifactId>
         <classifier>jdk15</classifier>
      </dependency>

      <dependency>
         <groupId>javax.servlet</groupId>
         <artifactId>servlet-api</artifactId>
      </dependency>

      <dependency>
         <groupId>javax.transaction</groupId>
         <artifactId>jta</artifactId>
      </dependency>
      
      <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>tck-utils-api</artifactId>
     </dependency>

      <dependency>
         <groupId>org.jboss.ejb3</groupId>
         <artifactId>jboss-ejb3-api</artifactId>
         <exclusions>
         	<exclusion>
         		<artifactId>jboss-jaxrpc</artifactId>
         		<groupId>jbossws</groupId>
         	</exclusion>
         	<exclusion>
         		<artifactId>jboss-transaction-api</artifactId>
         		<groupId>org.jboss.javaee</groupId>
         	</exclusion>
         	<exclusion>
         		<artifactId>jboss-jaxrpc</artifactId>
         		<groupId>jboss.jbossws</groupId>
         	</exclusion>
         </exclusions>
      </dependency>

      <dependency>
         <groupId>javax.annotation</groupId>
         <artifactId>jsr250-api</artifactId>
      </dependency>

      <dependency>
         <groupId>javax.jws</groupId>
         <artifactId>jsr181-api</artifactId>
      </dependency>

      <dependency>
         <groupId>log4j</groupId>
         <artifactId>log4j</artifactId>
      </dependency>

      <dependency>
         <groupId>javax.el</groupId>
         <artifactId>el-api</artifactId>
      </dependency>

      <dependency>
         <groupId>javax.faces</groupId>
         <artifactId>jsf-api</artifactId>
      </dependency>
      
      <dependency>
      	<groupId>javax.persistence</groupId>
      	<artifactId>persistence-api</artifactId>
      </dependency>

      <dependency>
         <groupId>commons-httpclient</groupId>
         <artifactId>commons-httpclient</artifactId>
      </dependency>
      
      <dependency>
         <groupId>net.sourceforge.htmlunit</groupId>
         <artifactId>htmlunit</artifactId>
      </dependency>

   </dependencies>

   <build>
   	<defaultGoal>install</defaultGoal>
      <plugins>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.2</version>
            <executions>
               <execution>
                  <id>attach-artifacts</id>
                  <phase>package</phase>
                  <goals>
                     <goal>attach-artifact</goal>
                  </goals>
                  <configuration>
                     <artifacts>
                        <artifact>
                           <file>${basedir}/src/main/resources/tck-tests.xml</file>
                           <type>xml</type>
                           <classifier>suite</classifier>
                        </artifact>
                        <artifact>
                           <file>${basedir}/src/main/resources/tck-audit.xml</file>
                           <type>xml</type>
                           <classifier>audit</classifier>
                        </artifact>
                     </artifacts>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
               <execution>
                  <id>copy-in-container-dependencies</id>
                  <phase>process-resources</phase>
                  <goals>
                     <goal>copy</goal>
                  </goals>
                  <configuration>
                     <outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
                     <stripVersion>true</stripVersion>
                     <artifactItems>
                        <artifactItem>
                           <groupId>org.jboss.test-harness</groupId>
                           <artifactId>jboss-test-harness</artifactId>
                           <overWrite>true</overWrite>
                        </artifactItem>
                     </artifactItems>
                  </configuration>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>
   
   <profiles>
      <profile>
         <id>tck-audit</id>
         <activation>
           <property>
             <name>tck-audit</name>
          </property>
        </activation>
         <dependencies>
            <dependency>
               <groupId>org.hibernate</groupId>
               <artifactId>tck-utils-impl</artifactId>
            </dependency>
        </dependencies>
        <build>
           <plugins>
              	<plugin>
              		<groupId>org.apache.maven.plugins</groupId>
              		<artifactId>maven-compiler-plugin</artifactId>
                  <configuration>
                     <source>1.5</source>
                     <target>1.5</target>
                     <compilerArgument>-AauditXml=${basedir}/src/main/resources/tck-audit.xml</compilerArgument>
                  </configuration>
              	</plugin>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-enforcer-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>enforce-versions</id>
                        <goals>
                           <goal>enforce</goal>
                        </goals>
                        <configuration>
                           <rules>
                              <requireJavaVersion>
                                 <version>1.6</version>
                              </requireJavaVersion>
                           </rules>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
               <plugin>
                  <groupId>org.codehaus.mojo</groupId>
                  <artifactId>build-helper-maven-plugin</artifactId>
                  <version>1.2</version>
                  <executions>
                     <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                           <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                           <artifacts>
                              <artifact>
                                 <file>${basedir}/src/main/resources/tck-tests.xml</file>
                                 <type>xml</type>
                                 <classifier>suite</classifier>
                              </artifact>
                              <artifact>
                                 <file>${basedir}/src/main/resources/tck-audit.xml</file>
                                 <type>xml</type>
                                 <classifier>audit</classifier>
                              </artifact>
                              <artifact>
                                 <file>../target/coverage.html</file>
                                 <type>html</type>
                                 <classifier>coverage</classifier>
                              </artifact>
                           </artifacts>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
           </plugins>
           <defaultGoal>compile</defaultGoal>
        </build>
      </profile>
      
      <profile>
         <id>write-artifacts-to-disk</id>
         <activation>
            <property>
               <name>dumpArtifacts</name>
            </property>
         </activation>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.codehaus.mojo</groupId>
                  <artifactId>exec-maven-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>generate-jsr-299-artifacts</id>
                        <phase>package</phase> 
                        <goals>
                        <goal>java</goal>
                        </goals>
                     </execution>
                  </executions>
                  <configuration>
                     <mainClass>org.jboss.jsr299.tck.api.TCK</mainClass>
                     <systemProperties>
                        <systemProperty>
                           <key>dumpArtifacts</key>
                           <value>true</value>
                        </systemProperty>
                        <systemProperty>
                           <key>org.jboss.jsr299.tck.outputDirectory</key>
                           <value>target/jsr299-artifacts</value>
                        </systemProperty>
                        <systemProperty>
                           <key>org.jboss.jsr299.tck.libraryDirectory</key>
                           <value>${libaryDir}</value>
                        </systemProperty>
                     </systemProperties>
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </profile>
      
   	<profile>
         <id>javax.xml.ws</id>
         <activation>
         	<jdk>1.5</jdk>
         </activation>
         <dependencies>
      	   <dependency>
      		   <groupId>javax.xml.ws</groupId>
      		   <artifactId>jaxws-api</artifactId>
    		   </dependency>
         </dependencies>
      </profile>

   </profiles>   

</project>
