<?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>16</version>
    </parent>

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

    <name>mod_cluster (parent)</name>
    <description>An httpd-based load balancer</description>
    <url>http://jboss.org/mod_cluster</url>

    <scm>
        <connection>scm:git:https://github.com/modcluster/mod_cluster.git</connection>
        <developerConnection>scm:git:https://github.com/modcluster/mod_cluster.git</developerConnection>
        <url>https://github.com/modcluster/mod_cluster</url>
        <tag>1.3.6.CR2</tag>
    </scm>

    <repositories>
        <!-- Getting started with JBoss Maven Repositories: https://community.jboss.org/wiki/MavenGettingStarted-Developers -->
        <repository>
            <id>jboss-public-repository-group</id>
            <name>JBoss Public Repository Group</name>
            <url>http://repository.jboss.org/nexus/content/groups/public/</url>
        </repository>
    </repositories>

    <properties>
        <!-- Override default 1.7 target/source in jboss-parent -->
        <maven.compiler.target>1.6</maven.compiler.target>
        <maven.compiler.source>1.6</maven.compiler.source>

        <!-- Dependency versions -->
        <version.jboss-logging>3.1.2.GA</version.jboss-logging>
        <version.jboss-logging-processor>1.1.0.Final</version.jboss-logging-processor>
        <version.tomcat6>6.0.35</version.tomcat6>
        <version.tomcat7>7.0.30</version.tomcat7>
        <version.tomcat8>8.0.21</version.tomcat8>
        <version.jbossweb>2.1.12.GA</version.jbossweb>
        <version.jbossweb7>7.2.1.Final</version.jbossweb7>
        <version.http-client>4.2.3</version.http-client>
        <version.jfreechart>1.0.13</version.jfreechart>
        <version.jcip-annotations>1.0</version.jcip-annotations>
        <version.junit>4.10</version.junit>
        <version.mockito>2.5.2</version.mockito>
        <version.javax.servlet-3.0>1.0.2.Final</version.javax.servlet-3.0>
    </properties>
    <dependencyManagement>
        <dependencies>
            <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.tomcat</groupId>
                <artifactId>catalina</artifactId>
                <version>${version.tomcat6}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>coyote</artifactId>
                <version>${version.tomcat6}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-catalina</artifactId>
                <version>${version.tomcat7}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-coyote</artifactId>
                <version>${version.tomcat7}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-util</artifactId>
                <version>${version.tomcat7}</version>
            </dependency>

            <dependency>
                <groupId>jboss.web</groupId>
                <artifactId>jbossweb</artifactId>
                <version>${version.jbossweb}</version>
            </dependency>
            <dependency>
                <groupId>jboss.web</groupId>
                <artifactId>servlet-api</artifactId>
                <version>${version.jbossweb}</version>
            </dependency>

            <dependency>
                <groupId>org.jboss.web</groupId>
                <artifactId>jbossweb</artifactId>
                <version>${version.jbossweb7}</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-release-plugin</artifactId>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                    <!-- After checking the created tag is correct, manually push the changes upstream with the release! -->
                    <pushChanges>false</pushChanges>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>1.3.1</version>
            </plugin>
            <!-- In order to build everything in one take, we need to use JDK7 because of the Tomcat 8
                  dependency, however we need to ensure that the code will be run correctly on JDK6 for Tomcat 6
                  support. -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>animal-sniffer-maven-plugin</artifactId>
                <version>1.14</version>
                <configuration>
                    <signature>
                        <groupId>org.codehaus.mojo.signature</groupId>
                        <artifactId>java16</artifactId>
                        <version>1.1</version>
                    </signature>
                </configuration>
                <executions>
                    <execution>
                        <id>ensure-java-1.6-class-library</id>
                        <phase>test</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <modules>
                <module>container-spi</module>
                <module>core</module>
                <module>container</module>
                <module>demo</module>
            </modules>
        </profile>
        <profile>
            <id>jdk9</id>
            <activation>
                <jdk>9</jdk>
            </activation>
            <modules>
                <module>container-spi</module>
                <module>core</module>
                <module>container</module>
                <module>demo</module>
            </modules>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>${version.compiler.plugin}</version>
                        <configuration>
                            <!-- Fork is needed so compiler args can be used -->
                            <fork>true</fork>
                            <compilerArgs>
                                <arg>-J--add-modules</arg>
                                <arg>-Jjava.annotations.common</arg>
                            </compilerArgs>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>AS7</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>container-spi</module>
                <module>core</module>
                <module>container</module>
                <module>demo</module>
            </modules>
        </profile>
        <profile>
            <id>TC8</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>container-spi</module>
                <module>core</module>
                <module>container</module>
           </modules>
        </profile>
        <profile>
            <id>TC7</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>container-spi</module>
                <module>core</module>
                <module>container</module>
            </modules>
        </profile>
        <profile>
            <id>TC6</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>container-spi</module>
                <module>core</module>
                <module>container</module>
            </modules>
        </profile>
        <profile>
            <id>dist</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>container-spi</module>
                <module>core</module>
                <module>container</module>
                <module>demo</module>
                <module>sar</module>
                <module>docs</module>
                <module>test/java</module>
            </modules>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-core-dependencies</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.jboss.mod_cluster</groupId>
                                            <artifactId>mod_cluster-parent</artifactId>
                                        </artifactItem>
                                    </artifactItems>
                                    <outputDirectory>${project.build.directory}/dependencies/lib</outputDirectory>
                                    <overWriteIfNewer>true</overWriteIfNewer>
                                    <stripVersion>true</stripVersion>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>bin</id>
                                <goals>
                                    <goal>attached</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <descriptors>
                                        <descriptor>src/assembly/bin.xml</descriptor>
                                    </descriptors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
