<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2014 - 2017 Blazebit.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.blazebit</groupId>
        <artifactId>blaze-persistence-core</artifactId>
        <version>1.2.0-Alpha2</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>blaze-persistence-core-testsuite</artifactId>
    <packaging>jar</packaging>

    <name>Blazebit Persistence Core Testsuite</name>

    <dependencies>

        <!-- Test dependencies -->

        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>blaze-persistence-core-api</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>blaze-persistence-core-impl</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>blaze-common-utils</artifactId>
        </dependency>

        <!-- If new integrations arrive, we can use profiles -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.googlecode.catch-exception</groupId>
            <artifactId>catch-exception</artifactId>
            <scope>compile</scope>
        </dependency>
        
        <!-- Add mockito early to the local maven repo since the Hibernate,DB2 build froze on downloading this dependency -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.10.19</version>
        </dependency>

    </dependencies>

    <profiles>
        <!-- RDBMS profiles -->
        <profile>
            <id>h2</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludedGroups>com.blazebit.persistence.testsuite.base.category.NoH2,${jpa.excludedGroups}</excludedGroups>
                            <systemPropertyVariables>
                                <jdbc.url>jdbc:h2:mem:test</jdbc.url>
                                <jdbc.user>admin</jdbc.user>
                                <jdbc.password>admin</jdbc.password>
                                <jdbc.driver>org.h2.Driver</jdbc.driver>
                            </systemPropertyVariables>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.maven.surefire</groupId>
                                <artifactId>surefire-junit47</artifactId>
                                <version>${version.surefire.plugin}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>com.h2database</groupId>
                    <artifactId>h2</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>mysql</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludedGroups>com.blazebit.persistence.testsuite.base.category.NoMySQL,${jpa.excludedGroups}</excludedGroups>
                            <systemPropertyVariables>
                                <jdbc.url>jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=utf8</jdbc.url>
                                <jdbc.user>root</jdbc.user>
                                <jdbc.password />
                                <jdbc.driver>com.mysql.jdbc.Driver</jdbc.driver>
                            </systemPropertyVariables>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.maven.surefire</groupId>
                                <artifactId>surefire-junit47</artifactId>
                                <version>${version.surefire.plugin}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>mysql</groupId>
                    <artifactId>mysql-connector-java</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>postgresql</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludedGroups>com.blazebit.persistence.testsuite.base.category.NoPostgreSQL,${jpa.excludedGroups}</excludedGroups>
                            <systemPropertyVariables>
                                <jdbc.url>jdbc:postgresql://localhost:5432/test</jdbc.url>
                                <jdbc.user>postgres</jdbc.user>
                                <jdbc.password>postgres</jdbc.password>
                                <jdbc.driver>org.postgresql.Driver</jdbc.driver>
                            </systemPropertyVariables>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.maven.surefire</groupId>
                                <artifactId>surefire-junit47</artifactId>
                                <version>${version.surefire.plugin}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>sqlite</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludedGroups>com.blazebit.persistence.testsuite.base.category.NoSQLite,${jpa.excludedGroups}</excludedGroups>
                            <systemPropertyVariables>
                                <jdbc.url>jdbc:sqlite:test.db</jdbc.url>
                                <jdbc.user />
                                <jdbc.password />
                                <jdbc.driver>org.sqlite.JDBC</jdbc.driver>
                            </systemPropertyVariables>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.maven.surefire</groupId>
                                <artifactId>surefire-junit47</artifactId>
                                <version>${version.surefire.plugin}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.xerial</groupId>
                    <artifactId>sqlite-jdbc</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>db2</id>
            <!-- In order to use this profile, you have to install the db2 driver 
                jars via: mvn -q install:install-file -Dfile=/PATH/TO/db2jcc4.jar -DgroupId=com.ibm.db2 
                -DartifactId=db2jcc4 -Dversion=9.7 -Dpackaging=jar -DgeneratePom=true mvn 
                -q install:install-file -Dfile=/PATH/TO/db2jcc_license_cu.jar -DgroupId=com.ibm.db2 
                -DartifactId=db2jcc_license_cu -Dversion=9.7 -Dpackaging=jar -DgeneratePom=true -->
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludedGroups>com.blazebit.persistence.testsuite.base.category.NoDB2,${jpa.excludedGroups}</excludedGroups>
                            <systemPropertyVariables>
                                <jdbc.url>jdbc:db2://localhost:50000/test</jdbc.url>
                                <jdbc.user>db2admin</jdbc.user>
                                <jdbc.password>db2admin</jdbc.password>
                                <jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
                            </systemPropertyVariables>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.maven.surefire</groupId>
                                <artifactId>surefire-junit47</artifactId>
                                <version>${version.surefire.plugin}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>com.ibm.db2</groupId>
                    <artifactId>db2jcc4</artifactId>
                    <version>9.7</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>com.ibm.db2</groupId>
                    <artifactId>db2jcc_license_cu</artifactId>
                    <version>9.7</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>firebird</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludedGroups>com.blazebit.persistence.testsuite.base.category.NoFirebird,${jpa.excludedGroups}</excludedGroups>
                            <systemPropertyVariables>
                                <jdbc.url>jdbc:firebirdsql:localhost:/tmp/test.fdb</jdbc.url>
                                <jdbc.user>SYSDBA</jdbc.user>
                                <jdbc.password>masterkey</jdbc.password>
                                <jdbc.driver>org.firebirdsql.jdbc.FBDriver</jdbc.driver>
                            </systemPropertyVariables>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.maven.surefire</groupId>
                                <artifactId>surefire-junit47</artifactId>
                                <version>${version.surefire.plugin}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.firebirdsql.jdbc</groupId>
                    <artifactId>jaybird-jdk16</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>oracle</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludedGroups>com.blazebit.persistence.testsuite.base.category.NoOracle,${jpa.excludedGroups}</excludedGroups>
                            <systemPropertyVariables>
                                <jdbc.url>jdbc:oracle:thin:@localhost:1521/xe</jdbc.url>
                                <jdbc.user>travis</jdbc.user>
                                <jdbc.password>travis</jdbc.password>
                                <jdbc.driver>oracle.jdbc.driver.OracleDriver</jdbc.driver>
                                <!-- Careful, we need this otherwise the ordering will be wrong... -->
                                <user.country>US</user.country>
                                <user.language>en</user.language>
                            </systemPropertyVariables>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.maven.surefire</groupId>
                                <artifactId>surefire-junit47</artifactId>
                                <version>${version.surefire.plugin}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>com.oracle</groupId>
                    <artifactId>ojdbc14</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>mssql</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludedGroups>com.blazebit.persistence.testsuite.base.category.NoMSSQL,${jpa.excludedGroups}</excludedGroups>
                            <systemPropertyVariables>
                                <jdbc.url>jdbc:sqlserver://localhost:1433</jdbc.url>
                                <jdbc.user>sa</jdbc.user>
                                <jdbc.password>Blaze-Persistence</jdbc.password>
                                <jdbc.driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbc.driver>
                            </systemPropertyVariables>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.maven.surefire</groupId>
                                <artifactId>surefire-junit47</artifactId>
                                <version>${version.surefire.plugin}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>com.microsoft.sqlserver</groupId>
                    <artifactId>mssql-jdbc</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>

        <!-- JPA provider profiles -->
        <profile>
            <id>hibernate</id>
            <properties>
                <jpa.excludedGroups>com.blazebit.persistence.testsuite.base.category.NoHibernate,com.blazebit.persistence.testsuite.base.category.NoHibernate42</jpa.excludedGroups>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-entitymanager</artifactId>
                    <version>${version.hibernate-4.2}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-integration-hibernate-4.2</artifactId>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-testsuite-base-hibernate</artifactId>
                    <scope>compile</scope>
                </dependency>
                <!-- IntelliJ apparently needs the annotation processor here -->
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-jpamodelgen</artifactId>
                    <version>1.3.0.Final</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.bsc.maven</groupId>
                        <artifactId>maven-processor-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>process</id>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <compilerArguments>${processor.plugin.compilerArguments}</compilerArguments>
                                    <!-- source output directory -->
                                    <outputDirectory>${project.build.directory}/test-metamodel</outputDirectory>
                                    <processors>
                                        <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
                                    </processors>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <!-- Metamodel -->
                            <dependency>
                                <groupId>org.hibernate</groupId>
                                <artifactId>hibernate-jpamodelgen</artifactId>
                                <version>1.3.0.Final</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${project.build.directory}/test-metamodel</source>
                                    </sources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>add-test-source-hibernate</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/test/hibernate</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>hibernate-4.3</id>
            <properties>
                <jpa.excludedGroups>com.blazebit.persistence.testsuite.base.category.NoHibernate,com.blazebit.persistence.testsuite.base.category.NoHibernate43</jpa.excludedGroups>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-entitymanager</artifactId>
                    <version>${version.hibernate-4.3}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-integration-hibernate-4.3</artifactId>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-testsuite-base-hibernate</artifactId>
                    <scope>compile</scope>
                </dependency>
                <!-- IntelliJ apparently needs the annotation processor here -->
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-jpamodelgen</artifactId>
                    <version>${version.hibernate-4.3}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.bsc.maven</groupId>
                        <artifactId>maven-processor-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>process</id>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <!-- source output directory -->
                                    <outputDirectory>${project.build.directory}/test-metamodel</outputDirectory>
                                    <processors>
                                        <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
                                    </processors>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <!-- Metamodel -->
                            <dependency>
                                <groupId>org.hibernate</groupId>
                                <artifactId>hibernate-jpamodelgen</artifactId>
                                <version>${version.hibernate-4.3}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${project.build.directory}/test-metamodel</source>
                                    </sources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>add-test-source-hibernate</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/test/hibernate</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>hibernate-5.0</id>
            <properties>
                <jpa.excludedGroups>com.blazebit.persistence.testsuite.base.category.NoHibernate,com.blazebit.persistence.testsuite.base.category.NoHibernate50</jpa.excludedGroups>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-entitymanager</artifactId>
                    <version>${version.hibernate-5}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-integration-hibernate-5</artifactId>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-testsuite-base-hibernate</artifactId>
                    <scope>compile</scope>
                </dependency>
                <!-- IntelliJ apparently needs the annotation processor here -->
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-jpamodelgen</artifactId>
                    <version>${version.hibernate-5}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.bsc.maven</groupId>
                        <artifactId>maven-processor-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>process</id>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <!-- source output directory -->
                                    <outputDirectory>${project.build.directory}/test-metamodel</outputDirectory>
                                    <processors>
                                        <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
                                    </processors>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <!-- Metamodel -->
                            <dependency>
                                <groupId>org.hibernate</groupId>
                                <artifactId>hibernate-jpamodelgen</artifactId>
                                <version>${version.hibernate-5}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${project.build.directory}/test-metamodel</source>
                                    </sources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>add-test-source-hibernate</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/test/hibernate</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>hibernate-5.1</id>
            <properties>
                <jpa.excludedGroups>com.blazebit.persistence.testsuite.base.category.NoHibernate,com.blazebit.persistence.testsuite.base.category.NoHibernate51</jpa.excludedGroups>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-entitymanager</artifactId>
                    <version>${version.hibernate-5.1}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-integration-hibernate-5</artifactId>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-testsuite-base-hibernate</artifactId>
                    <scope>compile</scope>
                </dependency>
                <!-- IntelliJ apparently needs the annotation processor here -->
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-jpamodelgen</artifactId>
                    <version>${version.hibernate-5.1}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.bsc.maven</groupId>
                        <artifactId>maven-processor-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>process</id>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <!-- source output directory -->
                                    <outputDirectory>${project.build.directory}/test-metamodel</outputDirectory>
                                    <processors>
                                        <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
                                    </processors>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <!-- Metamodel -->
                            <dependency>
                                <groupId>org.hibernate</groupId>
                                <artifactId>hibernate-jpamodelgen</artifactId>
                                <version>${version.hibernate-5.1}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${project.build.directory}/test-metamodel</source>
                                    </sources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>add-test-source-hibernate</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/test/hibernate</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>hibernate-5.2</id>
            <properties>
                <jpa.excludedGroups>com.blazebit.persistence.testsuite.base.category.NoHibernate</jpa.excludedGroups>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-entitymanager</artifactId>
                    <version>${version.hibernate-5.2}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-integration-hibernate-5.2</artifactId>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-testsuite-base-hibernate</artifactId>
                    <scope>compile</scope>
                </dependency>
                <!-- IntelliJ apparently needs the annotation processor here -->
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-jpamodelgen</artifactId>
                    <version>${version.hibernate-5.2}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.bsc.maven</groupId>
                        <artifactId>maven-processor-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>process</id>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <!-- source output directory -->
                                    <outputDirectory>${project.build.directory}/test-metamodel</outputDirectory>
                                    <processors>
                                        <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
                                    </processors>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <!-- Metamodel -->
                            <dependency>
                                <groupId>org.hibernate</groupId>
                                <artifactId>hibernate-jpamodelgen</artifactId>
                                <version>${version.hibernate-5.2}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${project.build.directory}/test-metamodel</source>
                                    </sources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>add-test-source-hibernate</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/test/hibernate</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>hibernate-6.0</id>
            <properties>
                <jpa.excludedGroups>com.blazebit.persistence.testsuite.base.category.NoHibernate</jpa.excludedGroups>
            </properties>
            <repositories>
                <repository>
                    <id>JBoss Snapshots</id>
                    <name>JBoss Snapshots</name>
                    <url>http://repository.jboss.org/nexus/content/groups/public/</url>
                </repository>
            </repositories>
            <dependencies>
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-entitymanager</artifactId>
                    <version>${version.hibernate-6.0}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-integration-hibernate-6.0</artifactId>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-testsuite-base-hibernate</artifactId>
                    <scope>compile</scope>
                </dependency>
                <!-- IntelliJ apparently needs the annotation processor here -->
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-jpamodelgen</artifactId>
                    <version>${version.hibernate-6.0}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.bsc.maven</groupId>
                        <artifactId>maven-processor-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>process</id>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <!-- source output directory -->
                                    <outputDirectory>${project.build.directory}/test-metamodel</outputDirectory>
                                    <processors>
                                        <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
                                    </processors>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <!-- Metamodel -->
                            <dependency>
                                <groupId>org.hibernate</groupId>
                                <artifactId>hibernate-jpamodelgen</artifactId>
                                <version>${version.hibernate-6.0}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${project.build.directory}/test-metamodel</source>
                                    </sources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>add-test-source-hibernate</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/test/hibernate</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>eclipselink</id>
            <properties>
                <jpa.excludedGroups>com.blazebit.persistence.testsuite.base.category.NoEclipselink</jpa.excludedGroups>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.eclipse.persistence</groupId>
                    <artifactId>eclipselink</artifactId>
                    <version>${version.eclipselink}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-testsuite-base-eclipselink</artifactId>
                    <scope>compile</scope>
                </dependency>
                <!-- IntelliJ apparently needs the annotation processor here -->
                <dependency>
                    <groupId>org.eclipse.persistence</groupId>
                    <artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
                    <version>${version.eclipselink}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.bsc.maven</groupId>
                        <artifactId>maven-processor-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>process</id>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <!-- source output directory -->
                                    <outputDirectory>${project.build.directory}/test-metamodel</outputDirectory>
                                    <processors>
                                        <processor>org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor</processor>
                                    </processors>
                                    <optionMap>
                                        <eclipselink.persistencexml>${basedir}/src/main/resources/META-INF/persistence.xml</eclipselink.persistencexml>
                                    </optionMap>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <!-- Metamodel -->
                            <dependency>
                                <groupId>org.eclipse.persistence</groupId>
                                <artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
                                <version>${version.eclipselink}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${project.build.directory}/test-metamodel</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>datanucleus-4</id>
            <properties>
                <jpa.excludedGroups>com.blazebit.persistence.testsuite.base.category.NoDatanucleus,com.blazebit.persistence.testsuite.base.category.NoDatanucleus4</jpa.excludedGroups>
            </properties>
            <repositories>
                <repository>
                    <id>DataNucleus Nightly</id>
                    <name>DataNucleus Repository Nightly</name>
                    <url>http://www.datanucleus.org/downloads/maven2-nightly</url>
                </repository>
            </repositories>
            <dependencies>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>javax.persistence</artifactId>
                    <version>2.1.2</version>
                </dependency>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-core</artifactId>
                    <version>${version.datanucleus.base-4}</version>
                </dependency>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-api-jpa</artifactId>
                    <version>${version.datanucleus.api-jpa-4}</version>
                </dependency>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-jpa-query</artifactId>
                    <version>${version.datanucleus.jpa-4}</version>
                </dependency>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-rdbms</artifactId>
                    <version>${version.datanucleus.rdbms-4}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-testsuite-base-datanucleus</artifactId>
                    <scope>compile</scope>
                </dependency>
                <!-- IntelliJ apparently needs the annotation processor here -->
                <!-- The old version has a bug when generating the static metamodel for PolymorphicPropertyMapBase -->
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-jpa-query</artifactId>
                    <version>${version.datanucleus.jpa-5}</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.datanucleus</groupId>
                        <artifactId>datanucleus-maven-plugin</artifactId>
                        <version>4.0.0-release</version>
                        <configuration>
                            <api>JPA</api>
                            <persistenceUnitName>TestsuiteBase</persistenceUnitName>
                            <verbose>false</verbose>
                            <fork>true</fork>
                            <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
                            <metadataDirectory>${project.build.outputDirectory}</metadataDirectory>
                            <useFileListFile>true</useFileListFile>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>process-classes</phase>
                                <goals>
                                    <goal>enhance</goal>
                                </goals>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>blaze-persistence-testsuite-base-datanucleus</artifactId>
                                <version>${project.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.bsc.maven</groupId>
                        <artifactId>maven-processor-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>process</id>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <!-- source output directory -->
                                    <outputDirectory>${project.build.directory}/test-metamodel</outputDirectory>
                                    <processors>
                                        <processor>org.datanucleus.jpa.query.JPACriteriaProcessor</processor>
                                    </processors>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <!-- The old version has a bug when generating the static metamodel for PolymorphicPropertyMapBase -->
                            <dependency>
                                <groupId>org.datanucleus</groupId>
                                <artifactId>datanucleus-jpa-query</artifactId>
                                <version>${version.datanucleus.jpa-5}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${project.build.directory}/test-metamodel</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>datanucleus-5</id>
            <properties>
                <jpa.excludedGroups>com.blazebit.persistence.testsuite.base.category.NoDatanucleus</jpa.excludedGroups>
            </properties>
            <repositories>
                <repository>
                    <id>DataNucleus Nightly</id>
                    <name>DataNucleus Repository Nightly</name>
                    <url>http://www.datanucleus.org/downloads/maven2-nightly</url>
                </repository>
            </repositories>
            <dependencies>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>javax.persistence</artifactId>
                    <version>2.1.2</version>
                </dependency>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-core</artifactId>
                    <version>${version.datanucleus.base-5}</version>
                </dependency>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-api-jpa</artifactId>
                    <version>${version.datanucleus.api-jpa-5}</version>
                </dependency>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-jpa-query</artifactId>
                    <version>${version.datanucleus.jpa-5}</version>
                </dependency>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-rdbms</artifactId>
                    <version>${version.datanucleus.rdbms-5}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-testsuite-base-datanucleus</artifactId>
                    <scope>compile</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.datanucleus</groupId>
                        <artifactId>datanucleus-maven-plugin</artifactId>
                        <version>4.0.0-release</version>
                        <configuration>
                            <api>JPA</api>
                            <persistenceUnitName>TestsuiteBase</persistenceUnitName>
                            <verbose>false</verbose>
                            <fork>true</fork>
                            <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
                            <metadataDirectory>${project.build.outputDirectory}</metadataDirectory>
                            <useFileListFile>true</useFileListFile>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>process-classes</phase>
                                <goals>
                                    <goal>enhance</goal>
                                </goals>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>blaze-persistence-testsuite-base-datanucleus</artifactId>
                                <version>${project.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.bsc.maven</groupId>
                        <artifactId>maven-processor-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>process</id>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <!-- source output directory -->
                                    <outputDirectory>${project.build.directory}/test-metamodel</outputDirectory>
                                    <processors>
                                        <processor>org.datanucleus.jpa.query.JPACriteriaProcessor</processor>
                                    </processors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${project.build.directory}/test-metamodel</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>openjpa</id>
            <properties>
                <jpa.excludedGroups>com.blazebit.persistence.testsuite.base.category.NoOpenJPA</jpa.excludedGroups>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.apache.openjpa</groupId>
                    <artifactId>openjpa-all</artifactId>
                    <version>${version.openjpa}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>blaze-persistence-testsuite-base-openjpa</artifactId>
                    <scope>compile</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.bsc.maven</groupId>
                        <artifactId>maven-processor-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>process</id>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <!-- source output directory -->
                                    <outputDirectory>${project.build.directory}/test-metamodel</outputDirectory>
                                    <processors>
                                        <processor>org.apache.openjpa.persistence.meta.AnnotationProcessor6</processor>
                                    </processors>
                                    <optionMap>
                                        <openjpa.metamodel>true</openjpa.metamodel>
                                    </optionMap>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.openjpa</groupId>
                                <artifactId>openjpa-all</artifactId>
                                <version>${version.openjpa}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${project.build.directory}/test-metamodel</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
