<?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 -->
  <parent>
    <groupId>io.openliberty.arquillian</groupId>
    <artifactId>arquillian-parent-liberty</artifactId>
    <version>1.0.2</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <!-- Model Version -->
  <modelVersion>4.0.0</modelVersion>
  
  <!-- Artifact Configuration -->
  <artifactId>arquillian-liberty-managed</artifactId>
  <name>Arquillian Container Liberty Managed</name>
  <description>Liberty Managed Container integration for the Arquillian Project</description>

  <properties>
    <skipTests>false</skipTests>
  </properties>

  <profiles>
    <profile>
      <id>jigsaw</id>
      <activation>
        <jdk>[1.9,)</jdk>
      </activation>
    </profile>
    <profile>
      <id>non-jigsaw</id>
      <activation>
        <jdk>[1.0,1.9)</jdk>
      </activation>
      <dependencies>
        <dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.6.0</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
        </dependency>
      </dependencies>
    </profile>
  </profiles>

  <!-- Build -->
  <build>
    <plugins>
      <plugin>
        <groupId>net.wasdev.wlp.maven.plugins</groupId>
        <artifactId>liberty-maven-plugin</artifactId>
        <version>1.2</version>
        <executions>
          <execution>
            <id>create-server</id>
            <!-- Plugin execution only succeeds here in the correct order because
                 execution id of the test is not 'default-test'.
                 Because Maven. See MNG-5799 and MNG-5987 -->
            <phase>test</phase>
            <goals>
              <goal>create-server</goal>
            </goals>
          </execution>
          <execution>
            <id>create-server-management</id>
            <!-- Plugin execution only succeeds here in the correct order because
                 execution id of the test is not 'default-test'.
                 Because Maven. See MNG-5799 and MNG-5987 -->
            <phase>test</phase>
            <configuration>
              <serverName>managementServer</serverName>
              <configFile>src/test/resources/server-with-management.xml</configFile>
            </configuration>
            <goals>
              <goal>create-server</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <skip>${skipTests}</skip>
          <serverName>defaultServer</serverName>
          <assemblyArtifact>
            <groupId>${runtimeGroupId}</groupId>
            <artifactId>${runtimeArtifactId}</artifactId>
            <version>${runtimeVersion}</version>
            <type>zip</type>
          </assemblyArtifact>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${version.surefire.plugin}</version>
        <configuration>
          <skip>true</skip>
          <systemProperties>
            <property>
              <name>java.util.logging.config.file</name>
              <value>${basedir}/src/test/resources/logging.properties</value>
            </property>
          </systemProperties>
          <argLine>-Dproject.build.directory=${project.build.directory}</argLine>
        </configuration>
        <executions>
          <execution>
            <id>wlp-dropins-deployment-test</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>${skipTests}</skip>
              <reportsDirectory>${project.build.directory}/surefire-reports/wlp-dropins-deployment-test
              </reportsDirectory>
              <systemPropertyVariables>
                <arquillian.launch>wlp-dropins-deployment</arquillian.launch>
              </systemPropertyVariables>
              <excludes>
                <exclude>**/needsmanagementmbeans/**</exclude>
              </excludes>
            </configuration>
          </execution>
          <execution>
            <id>wlp-xml-deployment-test</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>${skipTests}</skip>
              <reportsDirectory>${project.build.directory}/surefire-reports/wlp-xml-deployment-test</reportsDirectory>
              <systemPropertyVariables>
                <arquillian.launch>wlp-xml-deployment</arquillian.launch>
              </systemPropertyVariables>
              <excludes>
                <exclude>**/needsmanagementmbeans/**</exclude>
              </excludes>
            </configuration>
          </execution>
          <execution>
            <id>wlp-xml-management-deployment-test</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>${skipTests}</skip>
              <reportsDirectory>${project.build.directory}/surefire-reports/wlp-xml-management-deployment-test</reportsDirectory>
              <systemPropertyVariables>
                <arquillian.launch>wlp-xml-management-deployment</arquillian.launch>
              </systemPropertyVariables>
            </configuration>
          </execution>
          
        </executions>
      </plugin>
    </plugins>
  </build>

  <!-- Dependencies -->
  <dependencies>

    <!-- org.jboss.arquillian -->
    <dependency>
      <groupId>org.jboss.arquillian.container</groupId>
      <artifactId>arquillian-container-spi</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.container</groupId>
      <artifactId>arquillian-container-test-spi</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.protocol</groupId>
      <artifactId>arquillian-protocol-servlet</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.arquillian.testenricher</groupId>
      <artifactId>arquillian-testenricher-cdi</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.testenricher</groupId>
      <artifactId>arquillian-testenricher-ejb</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.testenricher</groupId>
      <artifactId>arquillian-testenricher-resource</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.testenricher</groupId>
      <artifactId>arquillian-testenricher-initialcontext</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.shrinkwrap.descriptors</groupId>
      <artifactId>shrinkwrap-descriptors-api-javaee</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.shrinkwrap.descriptors</groupId>
      <artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Java EE Spec APIs -->

    <dependency>
      <groupId>org.jboss.spec.javax.servlet</groupId>
      <artifactId>jboss-servlet-api_3.0_spec</artifactId>
      <version>[1.0,)</version>
    </dependency>

    <dependency>
      <groupId>javax.inject</groupId>
      <artifactId>javax.inject</artifactId>
      <version>1</version>
    </dependency>

    <dependency>
      <groupId>javax.enterprise</groupId>
      <artifactId>cdi-api</artifactId>
      <version>1.2</version>
    </dependency>

    <!-- WELD classes, these are present in FFDC
         and are sometimes instances of TCK @ShouldThrow exceptions -->

    <dependency>
      <groupId>org.jboss.weld</groupId>
      <artifactId>weld-core-bom</artifactId>
      <version>3.0.4.Final</version>
      <type>pom</type>
    </dependency>

    <!-- Testing -->

    <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-container</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

</project>
