<?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.vertx</groupId>
		<artifactId>wildfly-clustering-vertx-bom</artifactId>
		<version>2.0.0.Final</version>
		<relativePath>bom</relativePath>
	</parent>

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

	<name>WildFly Clustering: Vert.x: Modules</name>

	<properties>
		<jdk.runtime.args>-Dorg.jboss.logging.provider=jdk --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>
		<jacoco.skip>true</jacoco.skip>
		<maven.compiler.release>17</maven.compiler.release>

		<!-- 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.vertx>4.5.20</version.io.vertx>
		<version.org.kohsuke.metainf-services>1.11</version.org.kohsuke.metainf-services>
		<version.org.wildfly.clustering>7.0.12.Final</version.org.wildfly.clustering>

		<!-- Test dependency versions -->
		<version.org.assertj>3.27.4</version.org.assertj>
		<version.org.jacoco>0.8.12</version.org.jacoco>
		<version.org.jboss.arquillian>1.10.0.Final</version.org.jboss.arquillian>
		<version.org.jboss.logmanager>3.1.2.Final</version.org.jboss.logmanager>
		<version.org.jboss.shrinkwrap>1.2.6</version.org.jboss.shrinkwrap>
		<version.org.junit>5.13.4</version.org.junit>
		<version.org.mockito>5.19.0</version.org.mockito>
		<version.org.slf4j>2.0.17</version.org.slf4j>
		<version.org.testcontainers>1.21.3</version.org.testcontainers>
	</properties>

	<modules>
		<module>bom</module>
		<module>auth</module>
		<module>core</module>
		<module>web</module>
	</modules>

	<dependencyManagement>
		<dependencies>
			<!-- BOM dependencies -->
			<dependency>
				<groupId>io.vertx</groupId>
				<artifactId>vertx-stack</artifactId>
				<version>${version.io.vertx}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.assertj</groupId>
				<artifactId>assertj-bom</artifactId>
				<version>${version.org.assertj}</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.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.slf4j</groupId>
				<artifactId>slf4j-bom</artifactId>
				<version>${version.org.slf4j}</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>
			<dependency>
				<groupId>org.wildfly.clustering</groupId>
				<artifactId>wildfly-clustering-bom</artifactId>
				<version>${version.org.wildfly.clustering}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

			<!-- Compile dependencies -->
			<dependency>
				<groupId>org.kohsuke.metainf-services</groupId>
				<artifactId>metainf-services</artifactId>
				<version>${version.org.kohsuke.metainf-services}</version>
			</dependency>

			<!-- Test dependencies -->
			<dependency>
				<groupId>org.jboss.logmanager</groupId>
				<artifactId>jboss-logmanager</artifactId>
				<version>${version.org.jboss.logmanager}</version>
				<exclusions>
					<exclusion>
						<groupId>org.jboss.logging</groupId>
						<artifactId>jboss-logging</artifactId>
					</exclusion>
				</exclusions>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.logmanager</groupId>
			<artifactId>jboss-logmanager</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>
					</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>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>
						<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-resources-plugin</artifactId>
				<configuration>
					<overwrite>true</overwrite>
				</configuration>
			</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>

	<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>
						<executions>
							<execution>
								<id>javadoc-aggregate</id>
								<inherited>false</inherited>
								<goals>
									<goal>aggregate-jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
