<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2012 Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags.
  ~
  ~ 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
  ~
  ~     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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

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

    <groupId>io.quarkus.http</groupId>
    <artifactId>quarkus-http-parent</artifactId>
    <version>5.4.0</version>

    <name>Quarkus HTTP</name>
    <description>Quarkus HTTP</description>

    <packaging>pom</packaging>

    <licenses>
        <license>
            <name>Apache License Version 2.0</name>
            <url>http://repository.jboss.org/licenses/apache-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:quarkusio/quarkus-http.git</connection>
        <developerConnection>scm:git:git@github.com:quarkusio/quarkus-http.git</developerConnection>
        <url>https://github.com/quarkus/quarkus-http</url>
        <tag>5.4.0</tag>
    </scm>

    <properties>
        <!--
            Dependency versions. Please keep alphabetical.

            Each version property should be of the form "version.<groupId>".
            For example: <version.org.jboss.as>

            In cases where multiple artifacts use the same groupId but have different
            versions, add the artifactId or other qualifier to the property name.
            For example: <version.org.jboss.as.console>
         -->
        <version.com.h2database>1.4.197</version.com.h2database>
        <version.easymock>3.6</version.easymock>
        <version.junit>4.13.1</version.junit>
        <version.netty>4.1.111.Final</version.netty>
        <version.org.apache.directory.server>2.0.0-M15</version.org.apache.directory.server>
        <version.org.apache.httpmime>4.5.14</version.org.apache.httpmime>
        <version.org.apache.httpcomponents>4.5.14</version.org.apache.httpcomponents>
        <version.org.jboss.classfilewriter>1.2.4.Final</version.org.jboss.classfilewriter>
        <version.org.jboss.logging>3.6.1.Final</version.org.jboss.logging>
        <version.org.jboss.logging.processor>3.0.4.Final</version.org.jboss.logging.processor>
        <version.org.jboss.logmanager>2.1.19.Final</version.org.jboss.logmanager>
        <version.jakarta.annotations.api>2.1.1</version.jakarta.annotations.api>
        <version.jakarta.servlet>6.0.0</version.jakarta.servlet>
        <version.jakarta.websocket>2.1.0</version.jakarta.websocket>
        <version.vertx>4.5.10</version.vertx>
        <version.xnio>3.3.8.Final</version.xnio>

        <version.org.osgi.core>6.0.0</version.org.osgi.core>

        <!-- jacoco -->
        <version.org.jacoco>0.7.9</version.org.jacoco>
        <jacoco.agent.argLine />

        <!-- Surefire args -->
        <surefire.jpda.args />
        <surefire.system.args>-ea ${surefire.jpda.args} -Xmx1024m</surefire.system.args>
        <!--by default run all tests-->
        <test.categories>io.undertow.testutils.category.UnitTest OR NOT io.undertow.testutils.category.UnitTest</test.categories>

        <!-- maven-release-plugin -->
        <releaseProfiles>release</releaseProfiles>
        <signTag>false</signTag><!-- we don't sign tags as we don't want GPG secrets available in repository -->

        <!-- Checkstyle configuration -->
        <linkXRef>false</linkXRef>
        <version.io.undertow.build.checkstyle-config>1.0.1.Final</version.io.undertow.build.checkstyle-config>
        <version.com.github.spotbugs-maven-plugin>3.1.5</version.com.github.spotbugs-maven-plugin>
        <version.org.eclipse.jetty.alpn>1.1.3.v20160715</version.org.eclipse.jetty.alpn>

        <version.com.twitter.hpack>1.0.2</version.com.twitter.hpack>

        <!-- Non-default maven plugin versions and configuration -->
        <version.org.wildfly.openssl>2.2.5.Final</version.org.wildfly.openssl>
        <version.checkstyle>7.1</version.checkstyle>

        <checkstyle.skip>true</checkstyle.skip>

    </properties>

    <modules>
        <module>core</module>
        <module>servlet</module>
        <!--<module>examples</module>-->
        <module>http-core</module>
        <module>vertx</module>
        <module>websocket</module>
    </modules>

    <build>
        <extensions>
            <extension>
                <groupId>io.quarkus.bot</groupId>
                <artifactId>build-reporter-maven-extension</artifactId>
                <version>3.1.0</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>


            <!-- Zanata translations -->
            <plugin>
                <groupId>org.zanata</groupId>
                <artifactId>zanata-maven-plugin</artifactId>
                <version>${version.zanata.plugin}</version>
                <configuration>
                    <!-- Process sub-modules separately, sharing parent config -->
                    <enableModules>true</enableModules>
                    <projectConfig>${session.executionRootDirectory}/zanata.xml</projectConfig>
                    <!-- Generated English i18n.properties are written here: -->
                    <srcDir>target/classes</srcDir>
                    <transDir>src/main/resources</transDir>
                    <includes>**/*.i18n.properties,**/LocalDescriptions.properties</includes>
                </configuration>
            </plugin>

            <!-- Generate service files for classpath mode -->
            <plugin>
                <groupId>io.github.dmlloyd.maven</groupId>
                <artifactId>module-services-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <id>generate-services</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>

                <!-- Checkstyle -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${version.checkstyle.plugin}</version>
                    <configuration>
                        <configLocation>undertow-checkstyle/checkstyle.xml</configLocation>
                        <consoleOutput>true</consoleOutput>
                        <failsOnError>true</failsOnError>
                        <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        <useFile />
                        <sourceDirectories>
                            <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                        </sourceDirectories>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>io.undertow.build</groupId>
                            <artifactId>undertow-checkstyle-config</artifactId>
                            <version>${version.io.undertow.build.checkstyle-config}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>check-style</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>checkstyle</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- FindBugs -->
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>${version.com.github.spotbugs-maven-plugin}</version>
                    <configuration>
                        <excludeFilterFile>../spotbugs-exclude.xml</excludeFilterFile>
                    </configuration>
                    <executions>
                        <execution>
                            <id>find-bugs</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.jboss.logging</groupId>
                                <artifactId>jboss-logging-processor</artifactId>
                                <version>${version.org.jboss.logging.processor}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${version.surefire.plugin}</version>
                    <configuration>
                        <groups>${test.categories}</groups>
                        <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    </configuration>
                </plugin>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <!--suppress MavenModelInspection -->
                    <groupId>org.eclipse.m2e</groupId>
                    <!--suppress MavenModelInspection -->
                    <artifactId>lifecycle-mapping</artifactId>
                    <!--suppress MavenModelInspection -->
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-checkstyle-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.5,)
                                        </versionRange>
                                        <goals>
                                            <goal>checkstyle</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencyManagement>
        <dependencies>

            <!-- Modules in this project -->

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

            <dependency>
                <groupId>io.quarkus.http</groupId>
                <artifactId>quarkus-http-core</artifactId>
                <version>${project.version}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.quarkus.http</groupId>
                <artifactId>quarkus-http-websocket-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.quarkus.http</groupId>
                <artifactId>quarkus-http-websocket-servlet</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.quarkus.http</groupId>
                <artifactId>quarkus-http-http-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.quarkus.http</groupId>
                <artifactId>quarkus-http-vertx-backend</artifactId>
                <version>${project.version}</version>
            </dependency>

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

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

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

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

            <!-- External Dependencies -->

            <dependency>
                <groupId>io.undertow.build</groupId>
                <artifactId>undertow-checkstyle-config</artifactId>
                <version>${version.io.undertow.build.checkstyle-config}</version>
            </dependency>

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

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

            <dependency>
                <groupId>org.eclipse.jetty.alpn</groupId>
                <artifactId>alpn-api</artifactId>
                <version>${version.org.eclipse.jetty.alpn}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.easymock</groupId>
                <artifactId>easymock</artifactId>
                <version>${version.easymock}</version>
                <scope>test</scope>
            </dependency>

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

            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-web</artifactId>
                <version>${version.vertx}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-databind</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-buffer</artifactId>
                <version>${version.netty}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-codec-http</artifactId>
                <version>${version.netty}</version>
            </dependency>


            <dependency>
                <groupId>com.twitter</groupId>
                <artifactId>hpack</artifactId>
                <version>${version.com.twitter.hpack}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.directory.server</groupId>
                <artifactId>apacheds-all</artifactId>
                <version>${version.org.apache.directory.server}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${version.org.apache.httpcomponents}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpmime</artifactId>
                <version>${version.org.apache.httpmime}</version>
                <scope>test</scope>
            </dependency>

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

            <dependency>
                <groupId>org.jboss.logging</groupId>
                <artifactId>jboss-logging-annotations</artifactId>
                <version>${version.org.jboss.logging.processor}</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>

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

            <dependency>
                <groupId>jakarta.annotation</groupId>
                <artifactId>jakarta.annotation-api</artifactId>
                <version>${version.jakarta.annotations.api}</version>
            </dependency>

            <!-- TODO: replace with JBoss Spec Artifact-->
            <dependency>
                <groupId>jakarta.servlet</groupId>
                <artifactId>jakarta.servlet-api</artifactId>
                <version>${version.jakarta.servlet}</version>
            </dependency>

            <dependency>
                <groupId>jakarta.websocket</groupId>
                <artifactId>jakarta.websocket-api</artifactId>
                <version>${version.jakarta.websocket}</version>
            </dependency>

            <dependency>
                <groupId>jakarta.websocket</groupId>
                <artifactId>jakarta.websocket-client-api</artifactId>
                <version>${version.jakarta.websocket}</version>
            </dependency>

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

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

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

            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>${version.com.h2database}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.wildfly.openssl</groupId>
                <artifactId>wildfly-openssl</artifactId>
                <version>${version.org.wildfly.openssl}</version>
                <scope>test</scope>
            </dependency>


        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>jboss-public-repository-group</id>
            <name>JBoss Public Repository Group</name>
            <url>https://repository.jboss.org/nexus/content/groups/public/</url>
            <layout>default</layout>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>jboss-public-repository-group</id>
            <name>JBoss Public Repository Group</name>
            <url>https://repository.jboss.org/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <profiles>
        <profile>
            <id>spotbugs</id>
            <activation>
                <property>
                    <name>findbugs</name> <!-- not modified just for compatibility reason -->
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk9</id>
            <activation>
                <jdk>9</jdk>
            </activation>
            <build>
                <pluginManagement>
                    <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>
                                <failOnError>false</failOnError>
                                <compilerArgs>
                                    <arg>-J--add-opens=java.base/java.lang=ALL-UNNAMED</arg>
                                </compilerArgs>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>

        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-release-plugin</artifactId>
                        <configuration>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <tagNameFormat>@{project.version}</tagNameFormat>
                            <!-- Skip tests for now, we have a race condition in parallel(io.undertow.server.ssl.SimpleSSLTestCase) -->
                            <arguments>-DskipTests=true</arguments>

                            <pushChanges>false</pushChanges>
                            <localCheckout>true</localCheckout>
                            <remoteTagging>false</remoteTagging>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <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>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <doclint>none</doclint>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>test-coverage</id>
            <modules>
                <module>coverage-report</module>
            </modules>
            <properties>
                <jacoco.agent.argLine>${jacoco.activated.agent.argLine}</jacoco.agent.argLine>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${version.org.jacoco}</version>
                        <executions>
                            <execution>
                                <id>agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <includes>
                                        <include>io.undertow*</include>
                                    </includes>
                                    <propertyName>jacoco.activated.agent.argLine</propertyName>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>only-unit-tests</id>
            <activation>
                <property>
                    <name>onlyUnitTests</name>
                </property>
            </activation>
            <properties>
                <test.categories>io.undertow.testutils.category.UnitTest</test.categories>
            </properties>
        </profile>

        <profile>
            <id>skip-unit-tests</id>
            <activation>
                <property>
                    <name>skipUnitTests</name>
                </property>
            </activation>
            <properties>
                <test.categories>NOT io.undertow.testutils.category.UnitTest</test.categories>
            </properties>
        </profile>
    </profiles>

</project>
