<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <modelVersion>4.0.0</modelVersion>
   <parent>
      <groupId>org.infinispan</groupId>
      <artifactId>infinispan-hibernate-parent</artifactId>
      <version>15.2.5.Final</version>
      <relativePath>../pom.xml</relativePath>
   </parent>

   <artifactId>infinispan-hibernate-cache-v62</artifactId>
   <name>Infinispan Hibernate 6.2+ Cache</name>
   <description>Infinispan Hibernate 6.2+ Cache module</description>

   <properties>
      <!-- We only test with supported Hibernate releases: 6.2, 6.4 (default), 6.5 and 6.6 -->
      <version.hibernate.orm.6.2>6.2.32.Final</version.hibernate.orm.6.2>
      <version.hibernate.orm.6.5>6.5.3.Final</version.hibernate.orm.6.5>
      <version.hibernate.orm.6.6>6.6.1.Final</version.hibernate.orm.6.6>
   </properties>

   <dependencies>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-hibernate-cache-commons</artifactId>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-hibernate-cache-commons</artifactId>
         <type>test-jar</type>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-hibernate-cache-spi</artifactId>
      </dependency>
      <dependency>
         <groupId>jakarta.persistence</groupId>
         <artifactId>jakarta.persistence-api</artifactId>
      </dependency>
      <dependency>
         <groupId>jakarta.transaction</groupId>
         <artifactId>jakarta.transaction-api</artifactId>
         <version>${version.jakarta.transaction}</version>
      </dependency>
      <dependency>
         <groupId>org.glassfish.jaxb</groupId>
         <artifactId>jaxb-runtime</artifactId>
         <version>4.0.5</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>javax.activation</groupId>
         <artifactId>activation</artifactId>
         <scope>test</scope>
      </dependency>
   </dependencies>

   <build>
      <testResources>
         <testResource>
            <directory>${project.basedir}/src/test/resources</directory>
            <filtering>true</filtering>
         </testResource>
      </testResources>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <configuration>
               <configLocation>checkstyle.xml</configLocation>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${version.maven.surefire}</version>
            <configuration>
               <dependenciesToScan>
                  <dependency>${project.groupId}:infinispan-hibernate-cache-commons</dependency>
               </dependenciesToScan>
               <groups combine.self="override">${defaultJUnitGroups}</groups>
               <argLine>${forkJvmArgs} ${testjvm.jdkSpecificArgs} -Djdk.attach.allowAttachSelf=true</argLine>
               <parallel>none</parallel>
               <excludedGroups combine.self="override">${defaultExcludedJUnitGroups}</excludedGroups>
               <testNGArtifactName>none:none</testNGArtifactName>
               <properties combine.self="override">
                  <usedefaultlisteners>false</usedefaultlisteners>
                  <listener>${junitListener}</listener>
                  <log4j.configurationFile>${log4j.configurationFile}</log4j.configurationFile>
               </properties>
               <systemPropertyVariables>
                  <java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
                  <jgroups.ping.timeout>500</jgroups.ping.timeout>
                  <jgroups.ping.num_initial_members>1</jgroups.ping.num_initial_members>
                  <jgroups.udp.enable_bundling>false</jgroups.udp.enable_bundling>
                  <jgroups.bind_addr>localhost</jgroups.bind_addr>
                  <hibernate.cache.infinispan.jgroups_cfg>2lc-test-tcp.xml</hibernate.cache.infinispan.jgroups_cfg>
                  <infinispan.test.checkThreadLeaks>false</infinispan.test.checkThreadLeaks>
               </systemPropertyVariables>
            </configuration>
            <dependencies>
               <dependency>
                  <groupId>org.junit.vintage</groupId>
                  <artifactId>junit-vintage-engine</artifactId>
                  <version>${version.junit5}</version>
               </dependency>
            </dependencies>
            <executions>
               <!-- The default execution uses Hibernate 6.4 -->
               <execution>
                  <id>hibernate-6.2</id>
                  <goals>
                     <goal>test</goal>
                  </goals>
                  <phase>test</phase>
                  <configuration>
                     <reportNameSuffix>6_2</reportNameSuffix>
                     <classpathDependencyExcludes>
                        <classpathDependencyExclude>org.hibernate.orm:hibernate-core</classpathDependencyExclude>
                        <classpathDependencyExclude>org.hibernate.orm:hibernate-testing</classpathDependencyExclude>
                        <!-- org.hibernate.orm:hibernate-core transitives -->
                        <classpathDependencyExclude>org.glassfish.jaxb:jaxb-runtime</classpathDependencyExclude>
                        <classpathDependencyExclude>com.sun.istack:istack-commons-runtime</classpathDependencyExclude>
                        <classpathDependencyExclude>io.smallrye:jandex</classpathDependencyExclude>
                        <classpathDependencyExclude>org.glassfish.jaxb:jaxb-core</classpathDependencyExclude>
                        <classpathDependencyExclude>org.glassfish.jaxb:txw2</classpathDependencyExclude>
                        </classpathDependencyExcludes>
                     <additionalClasspathDependencies>
                        <additionalClasspathDependency>
                           <groupId>org.hibernate.orm</groupId>
                           <artifactId>hibernate-core</artifactId>
                           <version>${version.hibernate.orm.6.2}</version>
                        </additionalClasspathDependency>
                        <additionalClasspathDependency>
                           <groupId>org.hibernate.orm</groupId>
                           <artifactId>hibernate-testing</artifactId>
                           <version>${version.hibernate.orm.6.2}</version>
                           <exclusions>
                              <exclusion>
                                 <groupId>*</groupId>
                                 <artifactId>*</artifactId>
                              </exclusion>
                           </exclusions>
                        </additionalClasspathDependency>
                     </additionalClasspathDependencies>
                  </configuration>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>

   <profiles>
      <profile>
         <id>hibernate-matrix</id>
         <activation>
            <activeByDefault>false</activeByDefault>
         </activation>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-surefire-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>hibernate-6.5</id>
                        <goals>
                           <goal>test</goal>
                        </goals>
                        <phase>test</phase>
                        <configuration>
                           <reportNameSuffix>6_5</reportNameSuffix>
                           <classpathDependencyExcludes>
                              <classpathDependencyExclude>org.hibernate.orm:hibernate-core</classpathDependencyExclude>
                              <classpathDependencyExclude>org.hibernate.orm:hibernate-testing</classpathDependencyExclude>
                              <!-- org.hibernate.orm:hibernate-core transitives -->
                              <classpathDependencyExclude>org.antlr:antlr4-runtime</classpathDependencyExclude>
                              <classpathDependencyExclude>org.glassfish.jaxb:jaxb-runtime</classpathDependencyExclude>
                              <classpathDependencyExclude>com.sun.istack:istack-commons-runtime</classpathDependencyExclude>
                              <classpathDependencyExclude>io.smallrye:jandex</classpathDependencyExclude>
                              <classpathDependencyExclude>org.glassfish.jaxb:jaxb-core</classpathDependencyExclude>
                              <classpathDependencyExclude>org.glassfish.jaxb:txw2</classpathDependencyExclude>
                           </classpathDependencyExcludes>
                           <additionalClasspathDependencies>
                              <additionalClasspathDependency>
                                 <groupId>org.hibernate.orm</groupId>
                                 <artifactId>hibernate-core</artifactId>
                                 <version>${version.hibernate.orm.6.5}</version>
                              </additionalClasspathDependency>
                              <additionalClasspathDependency>
                                 <groupId>org.hibernate.orm</groupId>
                                 <artifactId>hibernate-testing</artifactId>
                                 <version>${version.hibernate.orm.6.5}</version>
                                 <exclusions>
                                    <exclusion>
                                       <groupId>*</groupId>
                                       <artifactId>*</artifactId>
                                    </exclusion>
                                 </exclusions>
                              </additionalClasspathDependency>
                           </additionalClasspathDependencies>
                        </configuration>
                     </execution>
                     <execution>
                        <id>hibernate-6.6</id>
                        <goals>
                           <goal>test</goal>
                        </goals>
                        <phase>test</phase>
                        <configuration>
                           <reportNameSuffix>6_6</reportNameSuffix>
                           <classpathDependencyExcludes>
                              <classpathDependencyExclude>org.hibernate.orm:hibernate-core</classpathDependencyExclude>
                              <classpathDependencyExclude>org.hibernate.orm:hibernate-testing</classpathDependencyExclude>
                              <!-- org.hibernate.orm:hibernate-core transitives -->
                              <classpathDependencyExclude>org.antlr:antlr4-runtime</classpathDependencyExclude>
                              <classpathDependencyExclude>org.glassfish.jaxb:jaxb-runtime</classpathDependencyExclude>
                              <classpathDependencyExclude>com.sun.istack:istack-commons-runtime</classpathDependencyExclude>
                              <classpathDependencyExclude>io.smallrye:jandex</classpathDependencyExclude>
                              <classpathDependencyExclude>org.glassfish.jaxb:jaxb-core</classpathDependencyExclude>
                              <classpathDependencyExclude>org.glassfish.jaxb:txw2</classpathDependencyExclude>
                           </classpathDependencyExcludes>
                           <additionalClasspathDependencies>
                              <additionalClasspathDependency>
                                 <groupId>org.junit.jupiter</groupId>
                                 <artifactId>junit-jupiter-engine</artifactId>
                                 <version>${version.junit5}</version>
                              </additionalClasspathDependency>
                              <additionalClasspathDependency>
                                 <groupId>org.hibernate.orm</groupId>
                                 <artifactId>hibernate-core</artifactId>
                                 <version>${version.hibernate.orm.6.6}</version>
                              </additionalClasspathDependency>
                              <additionalClasspathDependency>
                                 <groupId>org.hibernate.orm</groupId>
                                 <artifactId>hibernate-testing</artifactId>
                                 <version>${version.hibernate.orm.6.6}</version>
                                 <exclusions>
                                    <exclusion>
                                       <groupId>*</groupId>
                                       <artifactId>*</artifactId>
                                    </exclusion>
                                 </exclusions>
                              </additionalClasspathDependency>
                           </additionalClasspathDependencies>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>

</project>
