<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright The ClusterBench 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>41</version>
    </parent>

    <groupId>org.jboss.test</groupId>
    <artifactId>clusterbench</artifactId>
    <version>7.0.0.Final</version>
    <packaging>pom</packaging>
    <name>clusterbench</name>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <developerConnection>scm:git:git@github.com:clusterbench/clusterbench.git</developerConnection>
        <tag>7.0.0.Final</tag>
    </scm>

    <modules>
        <module>clusterbench-common</module>
        <module>clusterbench-ee10-ejb</module>
        <module>clusterbench-ee10-web</module>
        <module>clusterbench-ee10-ear</module>
    </modules>

    <properties>
        <linkXRef>false</linkXRef>
        <version.org.wildfly>30.0.0.Final</version.org.wildfly>
        <!-- TODO This needs to be updated manually for dependencies that are not managed by the BOM but should be. -->
        <version.org.infinispan>14.0.17.Final</version.org.infinispan>
        <version.org.wildfly.cloud-feature-pack>3.0.0.Final</version.org.wildfly.cloud-feature-pack>
        <version.org.wildfly.maven.plugin>4.2.1.Final</version.org.wildfly.maven.plugin>
        <!-- TODO workaround for https://github.com/jboss/jboss-parent-pom/pull/131#pullrequestreview-1129876725 -->
        <version.plexus.archiver>4.5.0</version.plexus.archiver>
        <wildfly.skip>true</wildfly.skip>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.wildfly.bom</groupId>
                <artifactId>wildfly-ee-with-tools</artifactId>
                <scope>import</scope>
                <type>pom</type>
                <version>${version.org.wildfly}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly</groupId>
                <artifactId>wildfly-clustering-web-api</artifactId>
                <!-- TODO this should be managed by the BOM! -->
                <version>${version.org.wildfly}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.infinispan</groupId>
                <artifactId>infinispan-client-hotrod</artifactId>
                <!-- TODO this should be managed by the BOM! -->
                <version>${version.org.infinispan}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <!-- Ban insecure non-https maven repositories -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.4.1</version>
                <executions>
                    <execution>
                        <id>enforce-java-version</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedRepositories>
                                    <bannedRepositories>http://*</bannedRepositories>
                                    <bannedPluginRepositories>http://*</bannedPluginRepositories>
                                </bannedRepositories>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <goals>deploy</goals>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.6.3</version>
                <configuration>
                    <!-- JDK8 has become extremely strict with JavaDoc problems -->
                    <failOnError>false</failOnError>
                </configuration>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.6.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.11.0</version>
                    <configuration>
                        <source>11</source>
                        <target>11</target>
                        <testSource>11</testSource>
                        <testTarget>11</testTarget>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-ear-plugin</artifactId>
                    <version>3.3.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-ejb-plugin</artifactId>
                    <version>3.2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>3.4.0</version>
                </plugin>
                <plugin>
                    <groupId>org.wildfly.plugins</groupId>
                    <artifactId>wildfly-maven-plugin</artifactId>
                    <version>${version.org.wildfly.maven.plugin}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>build-quickly</id>
            <activation>
                <property>
                    <name>quickly</name>
                </property>
            </activation>
            <properties>
                <skipTests>true</skipTests>
                <skipITs>true</skipITs>
                <maven.javadoc.skip>true</maven.javadoc.skip>
                <checkstyle.skip>true</checkstyle.skip>
                <enforcer.skip>true</enforcer.skip>
                <license.skip>true</license.skip>
                <wildfly.skip>true</wildfly.skip>
            </properties>
        </profile>
    </profiles>

    <!-- Setup <distributionManagement> until org.jboss:jboss-parent:42 which will add altReleaseDeploymentRepository/altSnapshotDeploymentRepository for the deploy plugin -->
    <!-- See https://github.com/jboss/jboss-parent-pom/pull/244 -->
    <distributionManagement>
        <repository>
            <id>${jboss.releases.repo.id}</id>
            <name>JBoss Releases Repository</name>
            <url>${jboss.releases.repo.url}</url>
        </repository>
        <snapshotRepository>
            <id>${jboss.snapshots.repo.id}</id>
            <name>JBoss Snapshots Repository</name>
            <url>${jboss.snapshots.repo.url}</url>
        </snapshotRepository>
    </distributionManagement>

</project>
