<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2022 Red Hat, Inc.
  ~
  ~ Red Hat licenses this file to you 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>io.vertx</groupId>
    <artifactId>vertx5-parent</artifactId>
    <version>15</version>
  </parent>

  <name>vertx-infinispan-parent</name>
  <artifactId>vertx-infinispan-parent</artifactId>
  <version>5.2.0</version>
  <packaging>pom</packaging>

  <scm>
    <connection>scm:git:git@github.com:vert-x3/vertx-infinispan.git</connection>
    <developerConnection>scm:git:git@github.com:vert-x3/vertx-infinispan.git</developerConnection>
    <url>git@github.com:vert-x3/vertx-infinispan.git</url>
  </scm>

  <properties>
    <!-- Must be the same version as in vertx-rx for dependency convergence -->
    <rxjava3.version>3.1.12</rxjava3.version>
    <!-- Must be the same version as in vertx-web for dependency convergence -->
    <caffeine.version>3.2.4</caffeine.version>
    <infinispan.version>16.2.1</infinispan.version>
    <wildfly-common.version>1.7.0.Final</wildfly-common.version>
    <smallrye-common-annotation>2.14.0</smallrye-common-annotation>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.vertx</groupId>
        <artifactId>vertx-dependencies</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-core</artifactId>
        <version>${infinispan.version}</version>
      </dependency>
      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-multimap</artifactId>
        <version>${infinispan.version}</version>
      </dependency>
      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-clustered-lock</artifactId>
        <version>${infinispan.version}</version>
      </dependency>
      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-clustered-counter</artifactId>
        <version>${infinispan.version}</version>
      </dependency>
      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-client-hotrod</artifactId>
        <version>${infinispan.version}</version>
      </dependency>
      <dependency>
        <groupId>com.github.ben-manes.caffeine</groupId>
        <artifactId>caffeine</artifactId>
        <version>${caffeine.version}</version>
      </dependency>
      <dependency>
        <groupId>io.reactivex.rxjava3</groupId>
        <artifactId>rxjava</artifactId>
        <version>${rxjava3.version}</version>
      </dependency>
      <dependency>
        <groupId>org.reactivestreams</groupId>
        <artifactId>reactive-streams</artifactId>
        <version>1.0.3</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <modules>
    <module>vertx-infinispan</module>
    <module>vertx-web-sstore-infinispan</module>
  </modules>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <executions>
            <execution>
              <id>default-compile</id>
              <configuration>
                <annotationProcessorPaths>
                  <annotationProcessorPath>
                    <groupId>io.vertx</groupId>
                    <artifactId>vertx-codegen</artifactId>
                    <classifier>processor</classifier>
                  </annotationProcessorPath>
                  <annotationProcessorPath>
                    <groupId>io.vertx</groupId>
                    <artifactId>vertx-docgen-processor</artifactId>
                    <classifier>processor</classifier>
                  </annotationProcessorPath>
                </annotationProcessorPaths>
                <compilerArgs>
                  <compilerArg>-Adocgen.source=${vertx.asciidoc.sources.dir}</compilerArg>
                  <compilerArg>-Adocgen.output=${project.build.directory}/asciidoc/java</compilerArg>
                  <compilerArg>-Amaven.groupId=${project.groupId}</compilerArg>
                  <compilerArg>-Amaven.artifactId=${project.artifactId}</compilerArg>
                  <compilerArg>-Amaven.version=${project.version}</compilerArg>
                  <compilerArg>-Ainfinispan.version=${infinispan.version}</compilerArg>
                </compilerArgs>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>package-docs</id>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <!-- Java 11 => use Maven Toolchain to compile this module with JDK 17
       The config file .m2/toolchains.xml is needed with this content

       <toolchains>
         <toolchain>
           <type>jdk</type>
           <provides>
             <id>Java17</id>
             <version>17</version>
           </provides>
           <configuration>
             <jdkHome>/PATH/TO/JDK/17</jdkHome>
           </configuration>
         </toolchain>
       </toolchains>
  -->
  <profiles>
    <profile>
      <id>Java11</id>
      <activation>
        <jdk>[11,17)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-toolchains-plugin</artifactId>
            <version>1.0</version>
            <executions>
              <execution>
                <phase>validate</phase>
                <goals>
                  <goal>toolchain</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <toolchains>
                <jdk>
                  <version>17</version>
                </jdk>
              </toolchains>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
