<?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</groupId>
    <artifactId>jboss-parent</artifactId>
    <version>14</version>
    <relativePath />
  </parent>

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

  <!-- Artifact Configuration -->
  <groupId>org.jboss.arquillian.extension</groupId>
  <artifactId>arquillian-persistence-parent</artifactId>
  <version>1.0.0.Alpha7</version>
  <packaging>pom</packaging>

  <name>Arquillian Persistence Extension Aggregator</name>
  <url>http://www.jboss.org</url>
  <description>Arquillian Persistence Extension Aggregator</description>

  <modules>
    <module>api</module>
    <module>core</module>
    <module>dbunit</module>
    <module>spi</module>
    <module>int-tests</module>
  </modules>

  <developers>
    <developer>
      <name>Bartosz Majsak</name>
      <timezone>UTC+1</timezone>
      <email>bartosz.majsak@gmail.com</email>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>GNU Lesser General Public License, Version 2.1</name>
      <distribution>repo</distribution>
      <url>http://www.gnu.org/licenses/lgpl-2.1.txt</url>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:arquillian/arquillian-extension-persistence.git</connection>
    <developerConnection>scm:git:git@github.com:arquillian/arquillian-extension-persistence.git</developerConnection>
    <url>https://github.com/arquillian/arquillian-extension-persistence</url>
    <tag>1.0.0.Alpha7</tag>
  </scm>

  <issueManagement>
    <system>jira</system>
    <url>https://issues.jboss.org/browse/ARQ/component/12314864</url>
  </issueManagement>

  <!-- Properties -->
  <properties>
    <!-- Versioning -->
    <version.arquillian_core>1.1.3.Final</version.arquillian_core>
    <version.arquillian_transaction>1.0.1.Final</version.arquillian_transaction>
    <version.fest.assert>1.4</version.fest.assert>
    <version.testng>5.14.6</version.testng>
    <version.mockito>1.9.5</version.mockito>
    <version.arq.container.glassfish>1.0.0.CR4</version.arq.container.glassfish>
    <version.glassfish>3.1.2.2</version.glassfish>
    <version.jbossas_7>7.0.2.Final</version.jbossas_7>
    <version.wildfly>8.0.0.Final</version.wildfly>
    <version.jbossas_spec>3.0.1.Final</version.jbossas_spec>
    <version.dbunit>2.5.0</version.dbunit>
    <version.mysql.driver>5.1.21</version.mysql.driver>
    <version.surefire.plugin>2.17</version.surefire.plugin>
    <version.shrinkwrap.resolver>2.0.0</version.shrinkwrap.resolver>
    <!-- override from parent -->
    <jdk.min.version>1.5</jdk.min.version>
    <maven.compiler.target>1.5</maven.compiler.target>
    <maven.compiler.source>1.5</maven.compiler.source>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.jboss.shrinkwrap.resolver</groupId>
        <artifactId>shrinkwrap-resolver-bom</artifactId>
        <version>${version.shrinkwrap.resolver}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.jboss.arquillian</groupId>
        <artifactId>arquillian-bom</artifactId>
        <version>${version.arquillian_core}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.arquillian</groupId>
        <artifactId>arquillian-build</artifactId>
        <version>${version.arquillian_core}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.arquillian.core</groupId>
        <artifactId>arquillian-core-impl-base</artifactId>
        <classifier>tests</classifier>
        <version>${version.arquillian_core}</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.arquillian.test</groupId>
        <artifactId>arquillian-test-impl-base</artifactId>
        <classifier>tests</classifier>
        <version>${version.arquillian_core}</version>
      </dependency>
      <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-transaction-bom</artifactId>
        <version>${version.arquillian_transaction}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.easytesting</groupId>
        <artifactId>fest-assert</artifactId>
        <version>${version.fest.assert}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>${version.testng}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>${version.mockito}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>

  </dependencyManagement>

  <build>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <pushChanges>false</pushChanges>
          <localCheckout>true</localCheckout>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <classpathDependencyExcludes>
            <classpathDependencyExcludes>
              javax.servlet:servlet-api
            </classpathDependencyExcludes>
            <classpathDependencyExcludes>
              org.apache.felix:javax.servlet
            </classpathDependencyExcludes>
          </classpathDependencyExcludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>signature-check</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <signature>
            <groupId>org.codehaus.mojo.signature</groupId>
            <artifactId>java15</artifactId>
            <version>1.0</version>
          </signature>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>glassfish-3.1-embedded-hsqldb</id>
      <dependencies>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-simple</artifactId>
          <version>1.7.2</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.arquillian.container</groupId>
          <artifactId>arquillian-glassfish-embedded-3.1</artifactId>
          <version>${version.arq.container.glassfish}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.glassfish.main.extras</groupId>
          <artifactId>glassfish-embedded-all</artifactId>
          <version>${version.glassfish}</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>org.hsqldb</groupId>
          <artifactId>hsqldb</artifactId>
          <version>2.2.8</version>
          <type>jar</type>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.arquillian.extension</groupId>
          <artifactId>arquillian-transaction-jta</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <testResources>
          <testResource>
            <directory>src/test/resources-datasets</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-scripts</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-glassfish-3.1-hsqldb</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-test-extension</directory>
          </testResource>
        </testResources>
      </build>
    </profile>
    <profile>
      <id>glassfish-3.1-embedded-derby</id>
      <dependencies>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-simple</artifactId>
          <version>1.7.2</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.arquillian.container</groupId>
          <artifactId>arquillian-glassfish-embedded-3.1</artifactId>
          <version>${version.arq.container.glassfish}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.glassfish.main.extras</groupId>
          <artifactId>glassfish-embedded-all</artifactId>
          <version>${version.glassfish}</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <artifactId>arquillian-transaction-jta</artifactId>
          <groupId>org.jboss.arquillian.extension</groupId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <testResources>
          <testResource>
            <directory>src/test/resources-datasets</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-scripts</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-glassfish-3.1-derby</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-test-extension</directory>
          </testResource>
        </testResources>
      </build>
    </profile>
    <profile>
      <id>jbossas-7.0-managed</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.jboss.arquillian.protocol</groupId>
          <artifactId>arquillian-protocol-servlet</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.as</groupId>
          <artifactId>jboss-as-arquillian-container-managed</artifactId>
          <version>${version.jbossas_7}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.spec</groupId>
          <artifactId>jboss-javaee-6.0</artifactId>
          <version>${version.jbossas_spec}</version>
          <type>pom</type>
          <scope>provided</scope>
          <exclusions>
            <exclusion>
              <groupId>xalan</groupId>
              <artifactId>xalan</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <artifactId>arquillian-transaction-jta</artifactId>
          <groupId>org.jboss.arquillian.extension</groupId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack</id>
                <phase>process-test-classes</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.jboss.as</groupId>
                      <artifactId>jboss-as-dist</artifactId>
                      <version>${version.jbossas_7}</version>
                      <type>zip</type>
                      <overWrite>false</overWrite>
                      <outputDirectory>${project.build.directory}</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
        <testResources>
          <testResource>
            <directory>src/test/resources-datasets</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-scripts</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-jboss-7.0.2</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-test-extension</directory>
          </testResource>
        </testResources>
      </build>
    </profile>
    <profile>
      <id>jbossas-7.1-managed-mssql</id>
      <dependencies>
        <dependency>
          <groupId>org.jboss.arquillian.protocol</groupId>
          <artifactId>arquillian-protocol-servlet</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.arquillian.extension</groupId>
          <artifactId>arquillian-transaction-jta</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.as</groupId>
          <artifactId>jboss-as-arquillian-container-managed</artifactId>
          <version>7.1.1.Final</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.spec</groupId>
          <artifactId>jboss-javaee-6.0</artifactId>
          <version>${version.jbossas_spec}</version>
          <type>pom</type>
          <scope>provided</scope>
          <exclusions>
            <exclusion>
              <groupId>xalan</groupId>
              <artifactId>xalan</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <!-- 1. Download this dependency from http://msdn.microsoft.com/en-us/sqlserver/aa937724
          2. install it in your local maven repository mvn install:install-file -Dfile=sqljdbc4.jar
          -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar -->
        <dependency>
          <groupId>com.microsoft.sqlserver</groupId>
          <artifactId>sqljdbc4</artifactId>
          <version>4.0</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.3</version>
            <executions>
              <execution>
                <id>unpack</id>
                <phase>process-test-classes</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.jboss.as</groupId>
                      <artifactId>jboss-as-dist</artifactId>
                      <version>7.1.1.Final</version>
                      <type>zip</type>
                      <overWrite>false</overWrite>
                      <outputDirectory>${project.build.directory}</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <!-- This test is causing problems with @DataSourceDefinition.
                  For some reason it's not picked up before test.jar deployment, so persistence.xml
                  is referring to non existing datasource. -->
                <exclude>**/UserPersistenceEarDeploymentTest.java</exclude>
                <!-- This test is using custom SQL which I don't want to
                  pollute with "SET INSERT_IDENTITY", because they should be portable. Hence
                  it's not essential for this profile to verify if this behaviour is correct
                  this test can be also skipped. It's tested on JBoss AS 7.0.2 with embedded
                  database. -->
                <exclude>**/DataCleanupStrategiesTest.java</exclude>
                <!-- Due to the bug in JBoss 7.1.1.Final / Infinispan cache eviction
                throws NPE. This feature has been tested with 7.0.2.Final as for now. -->
                <exclude>**/JpaCacheEvictionTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
        <testResources>
          <testResource>
            <directory>src/test/resources-datasets</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-scripts</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-jboss-7.1.1-mssql</directory>
          </testResource>
        </testResources>
      </build>
    </profile>
    <profile>
      <!-- In order to use this profile you need to have Oracle 11c installed and running -->
      <!-- For development purposes Oracle provides VirtualBox image with pre-configured database -->
      <!-- http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html -->
      <id>jbossas-7.1-managed-oracle11g</id>
      <dependencies>
        <dependency>
          <groupId>org.jboss.arquillian.protocol</groupId>
          <artifactId>arquillian-protocol-servlet</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.arquillian.extension</groupId>
          <artifactId>arquillian-transaction-jta</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.as</groupId>
          <artifactId>jboss-as-arquillian-container-managed</artifactId>
          <version>7.1.1.Final</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.spec</groupId>
          <artifactId>jboss-javaee-6.0</artifactId>
          <version>${version.jbossas_spec}</version>
          <type>pom</type>
          <scope>provided</scope>
          <exclusions>
            <exclusion>
              <groupId>xalan</groupId>
              <artifactId>xalan</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <!-- 1. Download this dependency from http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html
             2. install it in your local maven repository
                mvn install:install-file -Dfile=ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.2.0 -Dpackaging=jar -->
        <dependency>
          <groupId>com.oracle</groupId>
          <artifactId>ojdbc6</artifactId>
          <version>11.2.0.2.0</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.3</version>
            <executions>
              <execution>
                <id>unpack</id>
                <phase>process-test-classes</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.jboss.as</groupId>
                      <artifactId>jboss-as-dist</artifactId>
                      <version>7.1.1.Final</version>
                      <type>zip</type>
                      <overWrite>false</overWrite>
                      <outputDirectory>${project.build.directory}</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <!-- This test is causing problems with @DataSourceDefinition.
                  For some reason it's not picked up before test.jar deployment, so persistence.xml
                  is referring to non existing datasource. -->
                <exclude>**/UserPersistenceEarDeploymentTest.java</exclude>
                <!-- This test is using custom SQL which I don't want to
                  pollute with "SET INSERT_IDENTITY", because they should be portable. Hence
                  it's not essential for this profile to verify if this behaviour is correct
                  this test can be also skipped. It's tested on JBoss AS 7.0.2 with embedded
                  database. -->
                <exclude>**/DataCleanupStrategiesTest.java</exclude>
                <!-- Due to the bug in JBoss 7.1.1.Final / Infinispan cache eviction
                throws NPE. This feature has been tested with 7.0.2.Final as for now. -->
                <exclude>**/JpaCacheEvictionTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
        <testResources>
          <testResource>
            <directory>src/test/resources-datasets</directory>
          </testResource>
          <!-- Unlike other profiles we use scripts from the profile-specific resource folder
               so that they can use specific delimiters-->
          <testResource>
            <directory>src/test/resources-jboss-7.1.1-oracle11g</directory>
          </testResource>
        </testResources>
      </build>
    </profile>
    <profile>
      <id>jbossas-7.0-managed-mysql</id>
      <dependencies>
        <dependency>
          <groupId>org.jboss.arquillian.protocol</groupId>
          <artifactId>arquillian-protocol-servlet</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.arquillian.extension</groupId>
          <artifactId>arquillian-transaction-jta</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.as</groupId>
          <artifactId>jboss-as-arquillian-container-managed</artifactId>
          <version>7.0.2.Final</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.spec</groupId>
          <artifactId>jboss-javaee-6.0</artifactId>
          <version>${version.jbossas_spec}</version>
          <type>pom</type>
          <scope>provided</scope>
          <exclusions>
            <exclusion>
              <groupId>xalan</groupId>
              <artifactId>xalan</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>mysql</groupId>
          <artifactId>mysql-connector-java</artifactId>
          <version>${version.mysql.driver}</version>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack</id>
                <phase>process-test-classes</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.jboss.as</groupId>
                      <artifactId>jboss-as-dist</artifactId>
                      <version>7.0.2.Final</version>
                      <type>zip</type>
                      <overWrite>false</overWrite>
                      <outputDirectory>${project.build.directory}</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>add-test-source</id>
                <phase>generate-test-sources</phase>
                <goals>
                  <goal>add-test-source</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>src/test/java-jpa-cache-eviction</source>
                  </sources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <!-- This test is causing problems with @DataSourceDefinition.
                  For some reason it's not picked up before test.jar deployment, so persistence.xml
                  is referring to non existing datasource. -->
                <exclude>**/UserPersistenceEarDeploymentTest.java</exclude>
                <!-- This test is using custom SQL which I don't want to
                  pollute with "SET INSERT_IDENTITY", because they should be portable. Hence
                  it's not essential for this profile to verify if this behaviour is correct
                  this test can be also skipped. It's tested on JBoss AS 7.0.2 with embedded
                  database. -->
                <exclude>**/DataCleanupStrategiesTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
        <testResources>
          <testResource>
            <directory>src/test/resources-datasets</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-scripts</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-jboss-7.0.2-mysql</directory>
          </testResource>
        </testResources>
      </build>
    </profile>
    <profile>
      <id>jbossas-7.1-managed-postgresql</id>
      <dependencies>
        <dependency>
          <groupId>org.jboss.arquillian.protocol</groupId>
          <artifactId>arquillian-protocol-servlet</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.arquillian.extension</groupId>
          <artifactId>arquillian-transaction-jta</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.as</groupId>
          <artifactId>jboss-as-arquillian-container-managed</artifactId>
          <version>7.1.1.Final</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.spec</groupId>
          <artifactId>jboss-javaee-6.0</artifactId>
          <version>${version.jbossas_spec}</version>
          <type>pom</type>
          <scope>provided</scope>
          <exclusions>
            <exclusion>
              <groupId>xalan</groupId>
              <artifactId>xalan</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>postgresql</groupId>
          <artifactId>postgresql</artifactId>
          <version>9.1-901.jdbc4</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.3</version>
            <executions>
              <execution>
                <id>unpack</id>
                <phase>process-test-classes</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.jboss.as</groupId>
                      <artifactId>jboss-as-dist</artifactId>
                      <version>7.1.1.Final</version>
                      <type>zip</type>
                      <overWrite>false</overWrite>
                      <outputDirectory>${project.build.directory}</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <!-- This test is causing problems with @DataSourceDefinition.
                  For some reason it's not picked up before test.jar deployment, so persistence.xml
                  is referring to non existing datasource. -->
                <exclude>**/UserPersistenceEarDeploymentTest.java</exclude>
                <!-- This test is using custom SQL which I don't want to
                  pollute with "SET INSERT_IDENTITY", because they should be portable. Hence
                  it's not essential for this profile to verify if this behaviour is correct
                  this test can be also skipped. It's tested on JBoss AS 7.0.2 with embedded
                  database. -->
                <exclude>**/DataCleanupStrategiesTest.java</exclude>
                <!-- Due to the bug in JBoss 7.1.1.Final / Infinispan cache eviction
                throws NPE. This feature has been tested with 7.0.2.Final as for now. -->
                <exclude>**/JpaCacheEvictionTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
        <testResources>
          <testResource>
            <directory>src/test/resources-datasets</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-scripts</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-jboss-7.1.1-postgresql</directory>
          </testResource>
        </testResources>
      </build>
    </profile>
    <profile>
      <id>wildfly-managed</id>
      <dependencies>
        <dependency>
          <groupId>org.wildfly</groupId>
          <artifactId>wildfly-arquillian-container-managed</artifactId>
          <version>${version.wildfly}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.arquillian.protocol</groupId>
          <artifactId>arquillian-protocol-servlet</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.arquillian.extension</groupId>
          <artifactId>arquillian-transaction-jta</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.spec</groupId>
          <artifactId>jboss-javaee-6.0</artifactId>
          <version>${version.jbossas_spec}</version>
          <type>pom</type>
          <scope>provided</scope>
          <exclusions>
            <exclusion>
              <groupId>xalan</groupId>
              <artifactId>xalan</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>mysql</groupId>
          <artifactId>mysql-connector-java</artifactId>
          <version>${version.mysql.driver}</version>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack</id>
                <phase>process-test-classes</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.wildfly</groupId>
                      <artifactId>wildfly-dist</artifactId>
                      <version>${version.wildfly}</version>
                      <type>zip</type>
                      <overWrite>false</overWrite>
                      <outputDirectory>${project.build.directory}</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <!-- This test is using custom SQL which I don't want to
                  pollute with "SET INSERT_IDENTITY", because they should be portable. Hence
                  it's not essential for this profile to verify if this behaviour is correct
                  this test can be also skipped. It's tested on JBoss AS 7.0.2 with embedded
                  database. -->
                <exclude>**/DataCleanupStrategiesTest.java</exclude>
                <exclude>**/JpaCacheEvictionTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
        <testResources>
          <testResource>
            <directory>src/test/resources-datasets</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-scripts</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-wildfly-8.0.0</directory>
          </testResource>
        </testResources>
      </build>
    </profile>
    <profile>
      <id>tomee-1.5-managed</id>
      <dependencies>
        <dependency>
          <groupId>org.apache.openejb</groupId>
          <artifactId>arquillian-tomee-remote</artifactId>
          <version>1.5.2</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.openejb</groupId>
          <artifactId>apache-tomee</artifactId>
          <version>1.5.2</version>
          <classifier>webprofile</classifier>
          <type>zip</type>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.openejb</groupId>
          <artifactId>javaee-api</artifactId>
          <version>6.0-4</version>
          <scope>provided</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>**/JpaCacheEvictionTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
        <testResources>
          <testResource>
            <directory>src/test/resources-datasets</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-scripts</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-tomee-1.5</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources-test-extension</directory>
          </testResource>
        </testResources>
      </build>
    </profile>
  </profiles>
</project>
