<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ JBoss, Home of Professional Open Source
  ~ Copyright 2018 Red Hat Inc. and/or its affiliates and other contributors
  ~ as indicated by the @authors tag. All rights reserved.
  ~ See the copyright.txt in the distribution for a
  ~ full listing of individual contributors.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~v
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<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/maven-v4_0_0.xsd">

    <!-- Parent -->
    <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>19</version>
        <relativePath/>
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <groupId>io.hyperfoil</groupId>
    <artifactId>hyperfoil-all</artifactId>
    <packaging>pom</packaging>
    <version>0.19</version>
    <name>Hyperfoil</name>
    <description>Hyperfoil will rock your application with load</description>
    <scm>
        <connection>scm:git:git://github.com/Hyperfoil/Hyperfoil.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/Hyperfoil/Hyperfoil.git</developerConnection>
        <url>https://github.com/Hyperfoil/Hyperfoil</url>
        <tag>release-0.19</tag>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <modules>
        <module>api</module>
        <module>cli</module>
        <module>clustering</module>
        <module>controller-api</module>
        <module>core</module>
        <module>distribution</module>
        <module>http</module>
        <module>k8s-deployer</module>
        <module>plugins/codegen</module>
        <module>plugins/maven</module>
        <module>test-suite</module>
        <module>hotrod</module>
    </modules>

    <!-- Licenses -->
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <properties>

        <!-- maven-compiler-plugin -->
        <maven.compiler.target>11</maven.compiler.target>
        <maven.compiler.source>11</maven.compiler.source>

        <version.aesh>2.6</version.aesh>
        <version.apache.sshd>2.7.0</version.apache.sshd>
        <version.assertj>3.10.0</version.assertj>
        <version.eddsa>0.3.0</version.eddsa>
        <version.fabric8.kubernetes-client>4.6.0</version.fabric8.kubernetes-client>
        <version.jkube.maven-plugin>1.0.2</version.jkube.maven-plugin>
        <version.hdrhistogram>2.1.11</version.hdrhistogram>
        <version.javaparser>3.14.12</version.javaparser>
        <version.jackson>2.11.3</version.jackson>
        <version.marshalling>2.0.6.Final</version.marshalling>
        <version.junit>4.13.1</version.junit>
        <version.log4j2>2.17.1</version.log4j2>
        <version.metainf-services>1.8</version.metainf-services>
        <version.netty.tcnative.boringssl>2.0.42.Final</version.netty.tcnative.boringssl>
        <version.slf4j>1.7.32</version.slf4j>
        <version.snakeyaml>1.26</version.snakeyaml>
        <version.vertx>4.1.3</version.vertx>

        <version.sonatype.nexus>1.6.8</version.sonatype.nexus>
        <version.maven.source>3.0.1</version.maven.source>
        <version.maven.javadoc>3.2.0</version.maven.javadoc>
        <version.maven.gpg>1.6</version.maven.gpg>
        <version.maven-core>3.5.4</version.maven-core>
        <version.maven-plugin-annotations>3.5.1</version.maven-plugin-annotations>
        <version.maven-surefire-plugin>3.0.0-M5</version.maven-surefire-plugin>

        <exec.skip>true</exec.skip>
        <module.skipCopyDependencies>false</module.skipCopyDependencies>
    </properties>

    <developers>
        <developer>
            <name>Ståle Pedersen</name>
            <email>spederse@redhat.com</email>
            <organization>Red Hat</organization>
            <organizationUrl>http://www.redhat.com</organizationUrl>
        </developer>
        <developer>
            <name>John O'Hara</name>
            <email>johara@redhat.com</email>
            <organization>Red Hat</organization>
            <organizationUrl>http://www.redhat.com</organizationUrl>
        </developer>
        <developer>
            <name>Radim Vansa</name>
            <email>rvansa@redhat.com</email>
            <organization>Red Hat</organization>
            <organizationUrl>http://www.redhat.com</organizationUrl>
        </developer>
        <developer>
            <name>Will Reichert</name>
            <email>wreicher@redhat.com</email>
            <organization>Red Hat</organization>
            <organizationUrl>http://www.redhat.com</organizationUrl>
        </developer>
        <developer>
            <name>Jeremy Whiting</name>
            <email>jwhiting@redhat.com</email>
            <organization>Red Hat</organization>
            <organizationUrl>http://www.redhat.com</organizationUrl>
        </developer>
    </developers>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.hyperfoil</groupId>
                <artifactId>hyperfoil-api</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.hyperfoil</groupId>
                <artifactId>hyperfoil-cli</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.hyperfoil</groupId>
                <artifactId>hyperfoil-controller-api</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.hyperfoil</groupId>
                <artifactId>hyperfoil-core</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.hyperfoil</groupId>
                <artifactId>hyperfoil-core</artifactId>
                <type>test-jar</type>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.hyperfoil</groupId>
                <artifactId>hyperfoil-http</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.hyperfoil</groupId>
                <artifactId>hyperfoil-http</artifactId>
                <type>test-jar</type>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.hyperfoil</groupId>
                <artifactId>hyperfoil-hotrod</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.hyperfoil</groupId>
                <artifactId>hyperfoil-clustering</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.hyperfoil</groupId>
                <artifactId>hyperfoil-k8s-deployer</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.hyperfoil</groupId>
                <artifactId>hyperfoil-test-suite</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
            </dependency>

            <dependency>
                <groupId>io.hyperfoil</groupId>
                <artifactId>hyperfoil-codegen-maven-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.hyperfoil</groupId>
                <artifactId>hyperfoil-maven-plugin</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Netty will be logging through slf4j -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${version.slf4j}</version>
            </dependency>

            <!-- This is where all logging should end up -->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${version.log4j2}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${version.log4j2}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>${version.log4j2}</version>
            </dependency>

            <dependency>
                <groupId>org.hdrhistogram</groupId>
                <artifactId>HdrHistogram</artifactId>
                <version>${version.hdrhistogram}</version>
            </dependency>

            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-dependencies</artifactId>
                <version>${version.vertx}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${version.jackson}</version>
            </dependency>

            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>${version.snakeyaml}</version>
            </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${version.junit}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.sshd</groupId>
                <artifactId>sshd-core</artifactId>
                <version>${version.apache.sshd}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.sshd</groupId>
                <artifactId>sshd-scp</artifactId>
                <version>${version.apache.sshd}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.sshd</groupId>
                <artifactId>sshd-sftp</artifactId>
                <version>${version.apache.sshd}</version>
            </dependency>

            <dependency>
                <groupId>net.i2p.crypto</groupId>
                <artifactId>eddsa</artifactId>
                <version>${version.eddsa}</version>
            </dependency>

            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${version.assertj}</version>
            </dependency>

            <dependency>
                <groupId>org.aesh</groupId>
                <artifactId>aesh</artifactId>
                <version>${version.aesh}</version>
            </dependency>

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

            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-tcnative-boringssl-static</artifactId>
                <version>${version.netty.tcnative.boringssl}</version>
            </dependency>

            <dependency>
                <groupId>io.fabric8</groupId>
                <artifactId>kubernetes-client</artifactId>
                <version>${version.fabric8.kubernetes-client}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-plugin-api</artifactId>
                <version>${version.maven-core}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-core</artifactId>
                <version>${version.maven-core}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-annotations</artifactId>
                <version>${version.maven-plugin-annotations}</version>
            </dependency>

            <dependency>
                <groupId>com.github.javaparser</groupId>
                <artifactId>javaparser-core</artifactId>
                <version>${version.javaparser}</version>
            </dependency>

            <dependency>
                <groupId>org.jboss.marshalling</groupId>
                <artifactId>jboss-marshalling</artifactId>
                <version>${version.marshalling}</version>
            </dependency>

            <dependency>
                <groupId>org.jboss.marshalling</groupId>
                <artifactId>jboss-marshalling-river</artifactId>
                <version>${version.marshalling}</version>
            </dependency>

            <dependency>
                <groupId>org.jboss.marshalling</groupId>
                <artifactId>jboss-marshalling-serial</artifactId>
                <version>${version.marshalling}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <phase>install</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <copy file="${project.basedir}/config/pre-commit" todir="${project.basedir}/.git/hooks"/>
                                <chmod file="${project.basedir}/.git/hooks/pre-commit" perm="a+x"/>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.0.0-M2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
                <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>3.6.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${version.maven-surefire-plugin}</version>
                    <configuration>
                        <redirectTestOutputToFile>true</redirectTestOutputToFile>
                        <trimStackTrace>false</trimStackTrace>
                        <includes>
                            <include>**/*TestCase.java</include>
                            <include>**/*Test.java</include>
                        </includes>
                        <argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                        <forceJavacCompilerUse>true</forceJavacCompilerUse>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>2.17</version>
                    <executions>
                        <execution>
                            <id>validate</id>
                            <phase>validate</phase>
                            <configuration>
                                <configLocation>${project.basedir}/../config/checkstyle/checkstyle.xml</configLocation>
                                <consoleOutput>true</consoleOutput>
                                <failsOnError>true</failsOnError>
                                <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            </configuration>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.6.0</version>
                    <configuration>
                        <skip>${exec.skip}</skip>
                        <executable>false</executable>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.0.2</version>
                    <executions>
                        <execution>
                            <id>copy-dependencies</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>
                            <configuration>
                                <skip>${module.skipCopyDependencies}</skip>
                                <includeScope>runtime</includeScope>
                                <excludeScope>test</excludeScope>
                                <silent>true</silent>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.eclipse.jkube</groupId>
                    <artifactId>kubernetes-maven-plugin</artifactId>
                    <version>${version.jkube.maven-plugin}</version>
                </plugin>

                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${version.sonatype.nexus}</version>
                    <configuration>
                        <stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>

            <build>
                <plugins>
                    <!-- To release to Maven central -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <!-- To generate javadoc -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${version.maven.source}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${version.maven.javadoc}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <source>11</source>
                                    <detectJavaApiLink>false</detectJavaApiLink>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- To sign the artifacts -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${version.maven.gpg}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>

            </build>
        </profile>
    </profiles>
</project>
