<?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>org.jboss.arquillian</groupId>
    <artifactId>arquillian-build</artifactId>
    <version>1.9.3.Final</version>
    <relativePath>../../build/pom.xml</relativePath>
  </parent>

  <!-- Model Version -->
  <modelVersion>4.0.0</modelVersion>

  <!-- Artifact Configuration -->
  <groupId>org.jboss.arquillian.testenricher</groupId>
  <artifactId>arquillian-testenricher-ejb</artifactId>
  <name>Arquillian TestEnricher EJB</name>
  <description>EJB TestEnricher for the Arquillian Project</description>


  <!-- Properties -->
  <properties>

    <!-- Versioning -->
    <version.jboss-spec-ejb>1.0.2.Final</version.jboss-spec-ejb>
    <version.javax_ejb>3.0</version.javax_ejb>

  </properties>

  <!-- Dependencies -->
  <dependencies>

    <!-- org.jboss.arquillian -->
    <dependency>
      <groupId>org.jboss.arquillian.test</groupId>
      <artifactId>arquillian-test-spi</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.container</groupId>
      <artifactId>arquillian-container-test-spi</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.jboss.shrinkwrap</groupId>
      <artifactId>shrinkwrap-impl-base</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <!--
      Compile under 3.1, but run tests under EJB 3.0 and EJB 3.1.

      Re-execute Maven with a new profile in the test phase.
  -->
  <profiles>
    <profile>
      <id>ejb31</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.jboss.spec.javax.ejb</groupId>
          <artifactId>jboss-ejb-api_3.1_spec</artifactId>
          <version>${version.jboss-spec-ejb}</version>
          <scope>provided</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <reportsDirectory>${project.build.directory}/surefire-reports/EJB31/</reportsDirectory>
            </configuration>
          </plugin>
          <!-- This reexecution fails under release, since the new version does not exist in the repo
                              <plugin>
                                  <groupId>org.codehaus.mojo</groupId>
                                  <artifactId>exec-maven-plugin</artifactId>
                                  <version>1.2.1</version>
                                  <executions>
                                      <execution>
                                          <phase>test</phase>
                                          <goals>
                                              <goal>exec</goal>
                                          </goals>
                                      </execution>
                                  </executions>
                                  <configuration>
                                      <executable>mvn</executable>
                                      <arguments>
                                          <argument>test</argument>
                                          <argument>-P</argument>
                                          <argument>ejb30</argument>
                                      </arguments>
                                  </configuration>
                              </plugin>
          -->
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ejb30</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <dependencies>
        <dependency>
          <groupId>javax.ejb</groupId>
          <artifactId>ejb-api</artifactId>
          <version>${version.javax_ejb}</version>
          <scope>provided</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <includes>
                <include>**/*30*</include>
              </includes>
              <reportsDirectory>${project.build.directory}/surefire-reports/EJB30/</reportsDirectory>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>

