<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2021 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>vertx-infinispan-parent</artifactId>
    <version>4.4.2</version>
  </parent>

  <artifactId>vertx-infinispan</artifactId>

  <name>Vert.x Infinispan Cluster Manager</name>

  <properties>
    <doc.skip>false</doc.skip>
    <asciidoc.dir>${project.basedir}/src/main/asciidoc</asciidoc.dir>
    <jar.manifest>${project.basedir}/src/main/resources/META-INF/MANIFEST.MF</jar.manifest>
  </properties>

  <dependencies>

    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.infinispan</groupId>
      <artifactId>infinispan-core</artifactId>
      <version>${infinispan.version}</version>
      <exclusions>
        <exclusion>
          <groupId>io.reactivex.rxjava3</groupId>
          <artifactId>rxjava</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.wildfly.common</groupId>
          <artifactId>wildfly-common</artifactId>
        </exclusion>
        <exclusion>
          <artifactId>caffeine</artifactId>
          <groupId>com.github.ben-manes.caffeine</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.wildfly.common</groupId>
      <artifactId>wildfly-common</artifactId>
      <version>1.5.1.Final</version>
    </dependency>
    <dependency>
      <groupId>org.infinispan</groupId>
      <artifactId>infinispan-multimap</artifactId>
      <version>${infinispan.version}</version>
    </dependency>
    <!-- Same version as Camel 3 -->
    <dependency>
      <groupId>com.github.ben-manes.caffeine</groupId>
      <artifactId>caffeine</artifactId>
      <version>2.8.0</version>
      <exclusions>
        <!-- declared by caffeine, guava declares a different version -->
        <exclusion>
          <groupId>org.checkerframework</groupId>
          <artifactId>checker-qual</artifactId>
        </exclusion>
        <!-- declared by caffeine, guava declares a different version -->
        <exclusion>
          <groupId>com.google.errorprone</groupId>
          <artifactId>error_prone_annotations</artifactId>
        </exclusion>
      </exclusions>
    </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>
    <!-- Same version as vertx-rx-java3 -->
    <dependency>
      <groupId>io.reactivex.rxjava3</groupId>
      <artifactId>rxjava</artifactId>
      <version>${rxjava3.version}</version>
      <exclusions>
        <exclusion>
          <groupId>io.reactivestreams</groupId>
          <artifactId>reactive-streams</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.reactivestreams</groupId>
      <artifactId>reactive-streams</artifactId>
      <version>1.0.3</version>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-docgen</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-codegen</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-health-check</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-service-discovery</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-service-proxy</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-service-discovery</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.3.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.jayway.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>1.7.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.2.0</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.bsc.maven</groupId>
          <artifactId>maven-processor-plugin</artifactId>
          <executions>
            <execution>
              <id>generate-sources</id>
              <configuration>
                <optionMap>
                  <infinispan.version>${infinispan.version}</infinispan.version>
                </optionMap>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
            <systemPropertyVariables>
              <io.netty.leakDetectionLevel>PARANOID</io.netty.leakDetectionLevel>
              <buildDirectory>${project.build.directory}</buildDirectory>
              <vertxVersion>${project.version}</vertxVersion>
              <java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
              <vertx.logger-delegate-factory-class-name>io.vertx.core.logging.SLF4JLogDelegateFactory
              </vertx.logger-delegate-factory-class-name>
              <jgroups.join_timeout>1000</jgroups.join_timeout>
            </systemPropertyVariables>
            <!-- Needs to be small enough to run in a EC2 1.7GB small instance -->
            <argLine>-Xmx1200M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${project.build.directory}</argLine>
            <forkCount>1</forkCount>
            <reuseForks>true</reuseForks>
            <excludes>
              <exclude>**/it/**/*Test.java</exclude>
            </excludes>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.22.2</version>
        <executions>
          <execution>
            <id>core</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <phase>integration-test</phase>
            <configuration>
              <systemPropertyVariables>
                <io.netty.leakDetectionLevel>PARANOID</io.netty.leakDetectionLevel>
                <buildDirectory>${project.build.directory}</buildDirectory>
                <vertxVersion>${project.version}</vertxVersion>
                <java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
                <vertx.logger-delegate-factory-class-name>io.vertx.core.logging.SLF4JLogDelegateFactory
                </vertx.logger-delegate-factory-class-name>
                <jgroups.join_timeout>1000</jgroups.join_timeout>
              </systemPropertyVariables>
              <includes>
                <include>**/it/core/*Test.java</include>
              </includes>
              <classpathDependencyExcludes>
                <classpathDependencyExclude>io.vertx:vertx-core:test-jar</classpathDependencyExclude>
              </classpathDependencyExcludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>coverage</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <configuration>
                <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
                <systemPropertyVariables>
                  <io.netty.leakDetectionLevel>PARANOID</io.netty.leakDetectionLevel>
                  <buildDirectory>${project.build.directory}</buildDirectory>
                  <vertxVersion>${project.version}</vertxVersion>
                  <java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
                </systemPropertyVariables>
                <!-- Needs to be small enough to run in a EC2 1.7GB small instance -->
                <!-- append computed argLine computed by jacoco -->
                <argLine>-Xmx1200M</argLine>
                <forkCount>1</forkCount>
                <reuseForks>true</reuseForks>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>

</project>
