<?xml version="1.0" encoding="UTF-8"?>
<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>

    <groupId>com.github.nhenneaux.jersey.jetty.http2</groupId>
    <artifactId>jersey-http2-jetty</artifactId>
    <version>1.0.13</version>

    <packaging>pom</packaging>

    <name>JAX-RS HTTP/2 example for Java 8+</name>
    <description>JAX-RS (Jersey implementation) HTTP/2 with TLS client and server implementation with JSON parsing using
        Jackson and Jetty HTTP server/client. a new class JettyHttp2Connector is implemented based on the corresponding
        JettyConnector using HTTP/1.1 client (Inspired from
        https://stackoverflow.com/questions/40280843/use-http-2-with-jax-rs-client).
    </description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <sonar.organization>nhenneaux</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>

        <skipRelease>true</skipRelease>

        <jersey.version>2.35</jersey.version>
        <jetty.version>9.4.45.v20220203</jetty.version>

        <jakarta.activation.version>1.2.2</jakarta.activation.version>
        <jakarta.annotation.version>1.3.5</jakarta.annotation.version>
        <jakarta.xml.bind.version>2.3.2</jakarta.xml.bind.version>
        <jakarta.el-api.version>3.0.3</jakarta.el-api.version>
    </properties>


    <modules>
        <module>jersey-http2-jetty-connector</module>
        <module>jersey-http2-jetty-bundle</module>
    </modules>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.8.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>2.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>java8</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <properties>
                <!-- Sonar is not compatible with Java 8-->
                <sonar.skip>true</sonar.skip>
            </properties>
            <dependencies>
                <dependency>
                    <groupId>org.eclipse.jetty</groupId>
                    <artifactId>jetty-alpn-openjdk8-server</artifactId>
                    <version>${jetty.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.eclipse.jetty</groupId>
                    <artifactId>jetty-alpn-openjdk8-client</artifactId>
                    <version>${jetty.version}</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>java9+</id>
            <activation>
                <jdk>[1.9,)</jdk>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.eclipse.jetty</groupId>
                    <artifactId>jetty-alpn-java-server</artifactId>
                    <version>${jetty.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.eclipse.jetty</groupId>
                    <artifactId>jetty-alpn-java-client</artifactId>
                    <version>${jetty.version}</version>
                </dependency>
                <!-- Previously packaged libraries inside JDK -->
                <dependency>
                    <groupId>jakarta.activation</groupId>
                    <artifactId>jakarta.activation-api</artifactId>
                    <version>${jakarta.activation.version}</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>com.sun.activation</groupId>
                    <artifactId>jakarta.activation</artifactId>
                    <version>${jakarta.activation.version}</version>
                </dependency>

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

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

                <dependency>
                    <groupId>org.glassfish.jaxb</groupId>
                    <artifactId>jaxb-runtime</artifactId>
                    <version>${jakarta.xml.bind.version}</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.7</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.8.2</version>
                <configuration>
                    <skip>${skipRelease}</skip>
                    <locales>en</locales>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</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>3.2.0</version>
                <configuration>
                    <skip>${skipRelease}</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <configuration>
                    <skip>${skipRelease}</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                        <configuration>
                            <keyname>46E20128E3A624C11FFF6B95D1BA17265A0E8512</keyname>
                            <!-- Configuration to prevent the 'Signing Prompt' or the  -->
                            <!-- 'gpg: signing failed: No such file or directory' error -->
                            <!-- See https://myshittycode.com/2017/08/07/maven-gpg-plugin-prevent-signing-prompt-or-gpg-signing-failed-no-such-file-or-directory-error/ -->
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <!-- Set this to true and the release will automatically proceed and -->
                    <!-- sync to Central Repository will follow -->
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.thoughtworks.xstream</groupId>
                        <artifactId>xstream</artifactId>
                        <version>1.4.15</version> <!-- apparently this needs to be exactly this version -->
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.22.2</version>
                    <configuration>
                        <trimStackTrace>false</trimStackTrace>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.2</version>
                    <configuration>
                        <trimStackTrace>false</trimStackTrace>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <url>https://github.com/nhenneaux/jersey-http2-jetty-connector</url>

    <licenses>
        <license>
            <name>GNU LGPL 3</name>
            <url>http://www.gnu.org/licenses/lgpl.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:ssh://git@github.com:nhenneaux/jersey-http2-jetty-connector.git</connection>
        <url>https://github.com/nhenneaux/jersey-http2-jetty-connector</url>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
    </distributionManagement>

    <developers>
        <developer>
            <name>Nicolas Henneaux</name>
            <email>nicolas.henneaux@gmail.com</email>
            <roles>
                <role>Lead maintainer</role>
            </roles>
        </developer>
    </developers>
</project>
