<?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.6</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>
    <loggingPropertiesFile>${basedir}/src/test/resources/logging.properties</loggingPropertiesFile>
  </properties>

  <profiles>
    <profile>
      <id>log-info</id>
      <properties>
        <loggingPropertiesFile>${basedir}/src/test/resources/logging-info.properties</loggingPropertiesFile>
      </properties>
    </profile>
    <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>
    <profile>
      <id>java-11</id>
      <activation>
          <jdk>[11,)</jdk>
      </activation>
      <dependencies>
        <dependency>
          <groupId>javax.annotation</groupId>
          <artifactId>javax.annotation-api</artifactId>
          <version>1.3.2</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>

  <!-- Build -->
  <build>
    <plugins>
      <plugin>
        <groupId>net.wasdev.wlp.maven.plugins</groupId>
        <artifactId>liberty-maven-plugin</artifactId>
        <version>2.6.4</version>
        <configuration>
          <skip>${skipTests}</skip>
          <serverName>defaultServer</serverName>
          <assemblyArtifact>
            <groupId>${runtimeGroupId}</groupId>
            <artifactId>${runtimeArtifactId}</artifactId>
            <version>${runtimeVersion}</version>
            <type>zip</type>
          </assemblyArtifact>
          <serverEnv>src/test/resources/server.env</serverEnv>
        </configuration>
        <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>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>3.1.1</version>
            <executions>
              <execution>
                <id>extract-support-feature</id>
                <phase>test</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>arquillian-liberty-support</artifactId>
                  <version>${project.version}</version>
                  <type>zip</type>
                  <classifier>feature</classifier>
                  <overWrite>false</overWrite>
                  <outputDirectory>${project.build.directory}/liberty/wlp/usr</outputDirectory>
                </artifactItem>
              </artifactItems>
            </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>${loggingPropertiesFile}</value>
                </property>
              </systemProperties>
              <argLine>-Dproject.build.directory=${project.build.directory}</argLine>
              <trimStackTrace>false</trimStackTrace>
            </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>
                    <exclude>**/needssupportfeature/**</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>
                    <exclude>**/needssupportfeature/**</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>

        <dependency>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>fluent-hc</artifactId>
          <version>4.5.6</version>
        </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>
    
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>arquillian-liberty-support</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

</project>
