<?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/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>blaze-persistence-integration</artifactId>
        <groupId>com.blazebit</groupId>
        <version>1.2.0-Alpha4</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <name>Blazebit Persistence Integration Spring-Data</name>
    <artifactId>blaze-persistence-integration-spring-data</artifactId>

    <properties>
        <spring.activeProfiles />
        <test.argLine />
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-framework-bom</artifactId>
                <version>${version.spring}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.blazebit</groupId>
            <artifactId>blaze-persistence-entity-view-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.blazebit</groupId>
            <artifactId>blaze-persistence-jpa-criteria-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.blazebit</groupId>
            <artifactId>blaze-persistence-jpa-criteria-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
            <version>1.0.0.Final</version>
            <scope>provided</scope>
        </dependency>

        <!-- At runtime the user is going to need all dependencies anyway, so let's just give them through transitively -->
        <dependency>
            <groupId>com.blazebit</groupId>
            <artifactId>blaze-persistence-integration-entity-view-spring</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.blazebit</groupId>
            <artifactId>blaze-persistence-core-impl</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.blazebit</groupId>
            <artifactId>blaze-persistence-entity-view-impl</artifactId>
            <scope>runtime</scope>
        </dependency>

        <!-- Test Dependencies -->

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </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>
                                <activeProfiles>${spring.activeProfiles}</activeProfiles>
                            </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>
                                <activeProfiles>${spring.activeProfiles}</activeProfiles>
                            </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>
                                <activeProfiles>${spring.activeProfiles}</activeProfiles>
                            </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>
                                <activeProfiles>${spring.activeProfiles}</activeProfiles>
                            </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>db2inst1</jdbc.user>
                                <jdbc.password>db2inst1-pwd</jdbc.password>
                                <jdbc.driver>com.ibm.db2.jcc.DB2Driver</jdbc.driver>
                                <activeProfiles>${spring.activeProfiles}</activeProfiles>
                            </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>
                                <activeProfiles>${spring.activeProfiles}</activeProfiles>
                            </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>
                                <activeProfiles>${spring.activeProfiles}</activeProfiles>
                            </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>

        <!-- 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>
                <spring.activeProfiles>hibernate</spring.activeProfiles>
            </properties>
            <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>
                <spring.activeProfiles>hibernate</spring.activeProfiles>
            </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>
                <spring.activeProfiles>hibernate</spring.activeProfiles>
            </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>
                <spring.activeProfiles>hibernate</spring.activeProfiles>
            </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,com.blazebit.persistence.testsuite.base.category.NoHibernate52</jpa.excludedGroups>
                <spring.activeProfiles>hibernate</spring.activeProfiles>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <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>
                <spring.activeProfiles>hibernate</spring.activeProfiles>
            </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>
                <spring.activeProfiles>eclipselink</spring.activeProfiles>
                <surefire.jvm.params>-Xms1024m -Xmx2048m -javaagent:${project.build.directory}/agents/spring-instrumentation-agent.jar</surefire.jvm.params>
            </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>
                <dependency>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-entitymanager</artifactId>
                    <version>3.6.10.Final</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>jaxen</groupId>
                    <artifactId>jaxen</artifactId>
                    <version>1.1.6</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>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-agent</id>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.springframework</groupId>
                                            <artifactId>spring-instrument</artifactId>
                                            <outputDirectory>${project.build.directory}/agents</outputDirectory>
                                            <destFileName>spring-instrumentation-agent.jar</destFileName>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Only need this for IntelliJ -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>-javaagent:${project.build.directory}/agents/spring-instrumentation-agent.jar</argLine>
                        </configuration>
                    </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>
                <spring.activeProfiles>datanucleus</spring.activeProfiles>
            </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>test</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>TEST-PU</persistenceUnitName>
                            <verbose>false</verbose>
                            <fork>true</fork>
                            <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
                            <metadataDirectory>${project.build.testOutputDirectory}</metadataDirectory>
                            <useFileListFile>true</useFileListFile>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>process-test-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-test</id>
                                <goals>
                                    <goal>process-test</goal>
                                </goals>
                                <phase>generate-test-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-test-source-metamodel</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>add-test-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>
                <spring.activeProfiles>datanucleus</spring.activeProfiles>
            </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>test</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>TEST-PU</persistenceUnitName>
                            <verbose>false</verbose>
                            <fork>true</fork>
                            <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
                            <metadataDirectory>${project.build.testOutputDirectory}</metadataDirectory>
                            <useFileListFile>true</useFileListFile>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>process-test-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-test</id>
                                <goals>
                                    <goal>process-test</goal>
                                </goals>
                                <phase>generate-test-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-test-source-metamodel</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>add-test-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>
                <spring.activeProfiles>openjpa</spring.activeProfiles>
            </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 for various Spring-Data versions -->
        <profile>
            <id>spring-data-1.11.x</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <version.spring>4.3.3.RELEASE</version.spring>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>org.springframework.data</groupId>
                    <artifactId>spring-data-jpa</artifactId>
                    <version>1.11.1.RELEASE</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>spring-data-1.10.x</id>
            <properties>
                <version.spring>4.3.3.RELEASE</version.spring>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.data</groupId>
                    <artifactId>spring-data-jpa</artifactId>
                    <version>1.10.8.RELEASE</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

</project>