<?xml version="1.0" encoding="UTF-8"?>
<!--
	Copyright The WildFly Authors
	SPDX-License-Identifier: Apache-2.0
-->
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.wildfly.clustering</groupId>
		<artifactId>wildfly-clustering-bom</artifactId>
		<version>5.0.11.Final</version>
		<relativePath>bom</relativePath>
	</parent>

	<artifactId>wildfly-clustering</artifactId>
	<packaging>pom</packaging>

	<name>WildFly Clustering</name>

	<properties>
		<!-- Plugin configuration overrides -->
		<jacoco.skip>true</jacoco.skip>
		<javadoc.aggregation.skip>true</javadoc.aggregation.skip>
		<jdk.runtime.args>--add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED</jdk.runtime.args>
		<maven.compiler.release>17</maven.compiler.release>
		<!-- Skip redundant source packaging -->
		<skipReleaseAssembly>true</skipReleaseAssembly>

		<!-- Provided dependency versions -->
		<version.jakarta.transaction>2.0.1</version.jakarta.transaction>
		<version.net.jcip>1.0</version.net.jcip>

		<!-- Compile dependency versions -->
		<version.io.github.resilience4j>2.2.0</version.io.github.resilience4j>
		<version.org.infinispan>15.0.21.Final</version.org.infinispan>
		<version.org.jboss.logging>3.6.1.Final</version.org.jboss.logging>
		<version.org.jboss.marshalling>2.2.1.Final</version.org.jboss.marshalling>
		<version.org.jgroups>5.3.21.Final</version.org.jgroups>
		<version.org.kohsuke.metainf-services>1.11</version.org.kohsuke.metainf-services>
		<version.org.wildfly.common>1.7.0.Final</version.org.wildfly.common>

		<!-- Test dependency versions -->
		<version.io.undertow>2.3.18.Final</version.io.undertow>
		<version.org.apache.tomcat>11.0.2</version.org.apache.tomcat>
		<version.org.assertj>3.26.3</version.org.assertj>
		<version.org.jacoco>0.8.12</version.org.jacoco>
		<version.org.jboss.arquillian>1.9.1.Final</version.org.jboss.arquillian>
		<version.org.jboss.shrinkwrap>1.2.6</version.org.jboss.shrinkwrap>
		<version.org.junit>5.11.4</version.org.junit>
		<version.org.mockito>5.14.2</version.org.mockito>
		<version.org.testcontainers>1.20.4</version.org.testcontainers>
	</properties>

	<modules>
		<module>bom</module>
		<module>arquillian</module>
		<module>cache</module>
		<module>context</module>
		<module>marshalling</module>
		<module>server</module>
		<module>session</module>
	</modules>

	<dependencyManagement>
		<dependencies>
			<!-- Provided dependencies -->
			<dependency>
				<groupId>jakarta.transaction</groupId>
				<artifactId>jakarta.transaction-api</artifactId>
				<version>${version.jakarta.transaction}</version>
			</dependency>
			<dependency>
				<groupId>net.jcip</groupId>
				<artifactId>jcip-annotations</artifactId>
				<version>${version.net.jcip}</version>
			</dependency>

			<!-- BOM dependencies -->
			<dependency>
				<groupId>org.assertj</groupId>
				<artifactId>assertj-bom</artifactId>
				<version>${version.org.assertj}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.infinispan</groupId>
				<artifactId>infinispan-bom</artifactId>
				<version>${version.org.infinispan}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.junit</groupId>
				<artifactId>junit-bom</artifactId>
				<version>${version.org.junit}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.mockito</groupId>
				<artifactId>mockito-bom</artifactId>
				<version>${version.org.mockito}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.jboss.arquillian</groupId>
				<artifactId>arquillian-bom</artifactId>
				<version>${version.org.jboss.arquillian}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.jboss.shrinkwrap</groupId>
				<artifactId>shrinkwrap-bom</artifactId>
				<version>${version.org.jboss.shrinkwrap}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.testcontainers</groupId>
				<artifactId>testcontainers-bom</artifactId>
				<version>${version.org.testcontainers}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

			<!-- Compile dependencies -->
			<dependency>
				<groupId>io.github.resilience4j</groupId>
				<artifactId>resilience4j-retry</artifactId>
				<version>${version.io.github.resilience4j}</version>
			</dependency>
			<dependency>
				<groupId>org.jboss.logging</groupId>
				<artifactId>jboss-logging</artifactId>
				<version>${version.org.jboss.logging}</version>
			</dependency>
			<dependency>
				<groupId>org.jboss.marshalling</groupId>
				<artifactId>jboss-marshalling</artifactId>
				<version>${version.org.jboss.marshalling}</version>
			</dependency>
			<dependency>
				<groupId>org.jgroups</groupId>
				<artifactId>jgroups</artifactId>
				<version>${version.org.jgroups}</version>
			</dependency>
			<dependency>
				<groupId>org.kohsuke.metainf-services</groupId>
				<artifactId>metainf-services</artifactId>
				<version>${version.org.kohsuke.metainf-services}</version>
			</dependency>
			<dependency>
				<groupId>org.wildfly.common</groupId>
				<artifactId>wildfly-common</artifactId>
				<version>${version.org.wildfly.common}</version>
			</dependency>

			<!-- Test dependencies -->
			<dependency>
				<groupId>io.undertow</groupId>
				<artifactId>undertow-core</artifactId>
				<version>${version.io.undertow}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.tomcat</groupId>
				<artifactId>tomcat-catalina</artifactId>
				<version>${version.org.apache.tomcat}</version>
			</dependency>
			<dependency>
				<groupId>org.jboss.marshalling</groupId>
				<artifactId>jboss-marshalling-river</artifactId>
				<version>${version.org.jboss.marshalling}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-subclass</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<configuration>
					<configLocation>checkstyle.xml</configLocation>
					<logViolationsToConsole>true</logViolationsToConsole>
					<sourceDirectories>
						<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
						<sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
					</sourceDirectories>
				</configuration>
				<executions>
					<execution>
						<id>check-sources</id>
						<phase>process-sources</phase>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
					<execution>
						<id>check-test-sources</id>
						<phase>process-test-sources</phase>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<annotationProcessorPaths>
						<annotationProcessorPath>
							<groupId>org.kohsuke.metainf-services</groupId>
							<artifactId>metainf-services</artifactId>
						</annotationProcessorPath>
						<annotationProcessorPath>
							<groupId>org.infinispan</groupId>
							<artifactId>infinispan-component-processor</artifactId>
						</annotationProcessorPath>
						<annotationProcessorPath>
							<groupId>org.infinispan.protostream</groupId>
							<artifactId>protostream-processor</artifactId>
						</annotationProcessorPath>
					</annotationProcessorPaths>
				</configuration>
				<executions>
					<execution>
						<id>default-testCompile</id>
						<phase>test-compile</phase>
						<goals>
							<goal>testCompile</goal>
						</goals>
						<configuration>
							<parameters>true</parameters>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-java-agent</id>
						<phase>process-test-classes</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<includeGroupIds>org.mockito</includeGroupIds>
							<includeArtifactIds>mockito-core</includeArtifactIds>
							<stripVersion>true</stripVersion>
							<outputDirectory>${project.build.directory}/agent</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<executions>
					<execution>
						<id>default-integration-test</id>
						<phase>integration-test</phase>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
						<configuration>
							<trimStackTrace>false</trimStackTrace>
							<argLine>${jdk.runtime.args}</argLine>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<executions>
					<execution>
						<id>default-test-jar</id>
						<phase>package</phase>
						<goals>
							<goal>test-jar</goal>
						</goals>
						<configuration>
							<skipIfEmpty>true</skipIfEmpty>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<id>package-javadoc</id>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
							<goal>test-jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>package-source</id>
						<phase>package</phase>
						<goals>
							<goal>test-jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<argLine>${jdk.runtime.args} -javaagent:${project.build.directory}/agent/mockito-core.jar</argLine>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<reporting>
		<plugins>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<reportSets>
					<reportSet>
						<id>jacoco</id>
						<reports>
							<report>report</report>
							<report>report-integration</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>

	<profiles>
		<profile>
			<id>quickly</id>
			<properties>
				<checkstyle.skip>true</checkstyle.skip>
				<maven.javadoc.skip>true</maven.javadoc.skip>
				<skipTests>true</skipTests>
				<skipITs>true</skipITs>
			</properties>
		</profile>
		<profile>
			<id>jboss-release</id>
			<properties>
				<checkstyle.skip>true</checkstyle.skip>
				<skipTests>true</skipTests>
				<skipITs>true</skipITs>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<configuration>
							<sourceFileExcludes>org/wildfly/clustering/cache/infinispan/embedded/*/WildflyClustering*Impl.java</sourceFileExcludes>
						</configuration>
						<executions>
							<execution>
								<id>javadoc-aggregate</id>
								<inherited>false</inherited>
								<goals>
									<goal>aggregate-jar</goal>
								</goals>
								<configuration>
									<!-- Servlet spec modules are mutually exclusive -->
									<excludePackageNames>org.wildfly.clustering.session.spec.servlet:org.wildfly.clustering.session.spec.container:org.wildfly.clustering.session.spec.container.*</excludePackageNames>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>coverage</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-failsafe-plugin</artifactId>
						<configuration>
							<argLine>${argLine} ${jdk.runtime.args}</argLine>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<argLine>${argLine} ${jdk.runtime.args}</argLine>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>${version.org.jacoco}</version>
						<executions>
							<execution>
								<id>jacoco-prepare-agent</id>
								<goals>
									<goal>prepare-agent</goal>
									<goal>prepare-agent-integration</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
