<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2014, Red Hat Middleware LLC, and individual contributors
  ~ as indicated by the @author tags. See the copyright.txt file in the
  ~ distribution for a full listing of individual contributors.
  ~
  ~ This is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU Lesser General Public License as
  ~ published by the Free Software Foundation; either version 2.1 of
  ~ the License, or (at your option) any later version.
  ~
  ~ This software is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->
<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">
    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>39</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>org.jboss.mod_cluster</groupId>
    <artifactId>mod_cluster-parent</artifactId>
    <version>2.0.2.Final</version>
    <packaging>pom</packaging>

    <name>mod_cluster (parent)</name>
    <description>An httpd-based load balancer</description>
    <url>https://modcluster.io</url>

    <licenses>
        <license>
            <name>GNU Lesser General Public License v3.0 or later</name>
            <url>https://repository.jboss.org/licenses/lgpl-3.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:modcluster/mod_cluster.git</connection>
        <developerConnection>scm:git:git@github.com:modcluster/mod_cluster.git</developerConnection>
        <url>https://github.com/modcluster/mod_cluster</url>
        <tag>2.0.2.Final</tag>
    </scm>

    <modules>
        <module>core</module>
        <module>container</module>
        <module>load-spi</module>
        <module>demo</module>
        <module>dist</module>
    </modules>

    <properties>
        <!-- Require and build for JDK 11 -->
        <jdk.min.version>11</jdk.min.version>
        <jdk.release.version>11</jdk.release.version>

        <!-- Common dependency -->
        <version.jboss-logging>3.5.3.Final</version.jboss-logging>
        <version.jboss-logging-processor>2.2.1.Final</version.jboss-logging-processor>

        <!-- Demo dependencies -->
        <version.http-client>4.5.14</version.http-client>
        <version.jfreechart>1.0.13</version.jfreechart>
        <version.jcip-annotations>1.0</version.jcip-annotations>
        <version.junit>4.13.2</version.junit>
        <version.mockito>5.4.0</version.mockito>
        <version.javax.servlet-3.0>1.0.2.Final</version.javax.servlet-3.0>

        <!-- Plugin versions -->
        <version.org.wildfly.checkstyle-config>1.0.8.Final</version.org.wildfly.checkstyle-config>
        <version.org.jacoco.jacoco-maven-plugin>0.8.10</version.org.jacoco.jacoco-maven-plugin>
    </properties>

    <profiles>
        <!-- Code coverage report using JaCoCo -->
        <profile>
            <id>coverage</id>
            <activation>
                <property>
                    <name>coverage</name>
                </property>
            </activation>
            <modules>
                <module>code-coverage</module>
            </modules>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>jacoco-prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jboss.mod_cluster</groupId>
                <artifactId>mod_cluster-container-spi</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.mod_cluster</groupId>
                <artifactId>mod_cluster-container-tomcat-8.5</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.mod_cluster</groupId>
                <artifactId>mod_cluster-container-tomcat-9.0</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.mod_cluster</groupId>
                <artifactId>mod_cluster-container-tomcat-10.0</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.mod_cluster</groupId>
                <artifactId>mod_cluster-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.mod_cluster</groupId>
                <artifactId>mod_cluster-load-spi</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.mod_cluster</groupId>
                <artifactId>mod_cluster-demo</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.mod_cluster</groupId>
                <artifactId>mod_cluster-demo-client</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.mod_cluster</groupId>
                <artifactId>mod_cluster-demo-server</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.spec.javax.servlet</groupId>
                <artifactId>jboss-servlet-api_3.0_spec</artifactId>
                <version>${version.javax.servlet-3.0}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.logging</groupId>
                <artifactId>jboss-logging</artifactId>
                <version>${version.jboss-logging}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.logging</groupId>
                <artifactId>jboss-logging-processor</artifactId>
                <version>${version.jboss-logging-processor}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${version.http-client}</version>
            </dependency>
            <dependency>
                <groupId>jfree</groupId>
                <artifactId>jfreechart</artifactId>
                <version>${version.jfreechart}</version>
            </dependency>
            <dependency>
                <groupId>net.jcip</groupId>
                <artifactId>jcip-annotations</artifactId>
                <version>${version.jcip-annotations}</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${version.junit}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${version.mockito}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

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

    <build>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
            <resource>
                <directory>${project.build.sourceDirectory}</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <goals>
                    <goal>compile</goal>
                </goals>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <release>${jdk.release.version}</release>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <!-- Workaround for compiling on JDK11 -->
                    <!-- ModClusterLogger_$logger.java:6: error: package javax.annotation does not exist; for @Generated -->
                    <additionalDependencies>
                        <additionalDependency>
                            <groupId>javax.annotation</groupId>
                            <artifactId>javax.annotation-api</artifactId>
                            <version>1.3.2</version>
                        </additionalDependency>
                    </additionalDependencies>
                    <source>${jdk.release.version}</source>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.16.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>check-style</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>checkstyle</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.wildfly.checkstyle</groupId>
                            <artifactId>wildfly-checkstyle-config</artifactId>
                            <version>${version.org.wildfly.checkstyle-config}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <linkXRef>false</linkXRef>
                        <configLocation>wildfly-checkstyle/checkstyle.xml</configLocation>
                        <consoleOutput>true</consoleOutput>
                        <failsOnError>true</failsOnError>
                        <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        <excludes>**/*$logger.java,**/*$bundle.java</excludes>
                        <useFile />
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${version.org.jacoco.jacoco-maven-plugin}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
