<?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.4.SP3</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.jboss.jsr299.tck</groupId>
   <artifactId>jsr299-tck-impl</artifactId>
   <name>CDI TCK tests</name>

   <description>CDI TCK tests</description>

   <dependencies>

      <dependency>
         <groupId>javax.enterprise</groupId>
         <artifactId>cdi-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.servlet.jsp</groupId>
         <artifactId>jsp-api</artifactId>
      </dependency>

      <dependency>
         <groupId>javax.transaction</groupId>
         <artifactId>jta</artifactId>
      </dependency>

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

      <dependency>
         <groupId>org.jboss.test-audit</groupId>
         <artifactId>jboss-test-audit-api</artifactId>
      </dependency>

      <dependency>
         <groupId>org.jboss.ejb3</groupId>
         <artifactId>jboss-ejb3-api</artifactId>
      </dependency>

      <!--
         TODO replace with javax.interceptor:interceptor-api:3.1 once
         the JCP/Sun publish this
      -->
      <dependency>
         <groupId>org.jboss.spec.javax.interceptor</groupId>
         <artifactId>jboss-interceptors-api_1.1_spec</artifactId>
      </dependency>

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

      <dependency>
         <groupId>javax.jws</groupId>
         <artifactId>jsr181-api</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.inject</groupId>
         <artifactId>javax.inject</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>
            <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-mb.xml</file>
                           <type>xml</type>
                           <classifier>audit-mb</classifier>
                        </artifact>
                        <artifact>
                           <file>${basedir}/src/main/resources/tck-audit-cdi.xml</file>
                           <type>xml</type>
                           <classifier>audit-cdi</classifier>
                        </artifact>
                        <artifact>
                           <file>${basedir}/src/main/resources/tck-audit-int.xml</file>
                           <type>xml</type>
                           <classifier>audit-int</classifier>
                        </artifact>
                        <artifact>
                           <file>${basedir}/src/main/resources/cdi-api.sig</file>
                           <type>sig</type>
                           <classifier>sigtest</classifier>
                        </artifact>
                        <artifact>
                           <file>${basedir}/src/main/resources/cdi-api-jdk7.sig</file>
                           <type>sig</type>
                           <classifier>sigtest-jdk7</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>
                  <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>
            <jdk>1.6</jdk>
         </activation>
         <dependencies>
            <dependency>
               <groupId>org.jboss.test-audit</groupId>
               <artifactId>jboss-test-audit-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-cdi.xml,${basedir}/src/main/resources/tck-audit-mb.xml,${basedir}/src/main/resources/tck-audit-int.xml</compilerArgument>
                  </configuration>
               </plugin>
               <plugin>
                  <groupId>org.codehaus.mojo</groupId>
                  <artifactId>build-helper-maven-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>attach-report-artifacts</id>
                        <phase>package</phase>
                        <goals>
                           <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                           <artifacts>
                              <artifact>
                                 <file>../target/coverage-cdi.html</file>
                                 <type>html</type>
                                 <classifier>coverage-cdi</classifier>
                              </artifact>
                              <artifact>
                                 <file>../target/coverage-mb.html</file>
                                 <type>html</type>
                                 <classifier>coverage-mb</classifier>
                              </artifact>
                              <artifact>
                                 <file>../target/coverage-int.html</file>
                                 <type>html</type>
                                 <classifier>coverage-int</classifier>
                              </artifact>
                           </artifacts>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </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>

   <scm>
       <connection>scm:git:git://github.com/jboss/cditck.git</connection>
       <developerConnection>scm:git:git@github.com:jboss/cditck.git</developerConnection>
       <url>https://github.com/jboss/cditck</url>
    </scm>


</project>
