<?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.kumuluz.ee.rest-client</groupId>
    <artifactId>kumuluzee-rest-client</artifactId>
    <version>1.2.2</version>

    <name>KumuluzEE Microprofile Rest Client</name>
    <inceptionYear>2018</inceptionYear>
    <description>Implementation of Microprofile Rest Client</description>
    <url>https://ee.kumuluz.com</url>

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

        <jaxb-api.version>2.3.0</jaxb-api.version>

        <kumuluzee.version>3.2.0</kumuluzee.version>
        <microprofile.rest-client.version>1.2.1</microprofile.rest-client.version>
        <microprofile.config.version>1.3</microprofile.config.version>
        <microprofile.fault-tolerance.version>1.1.4</microprofile.fault-tolerance.version>
        <jersey-media.version>2.28</jersey-media.version>

        <kumuluzee.config.version>1.3.0</kumuluzee.config.version>
        <kumuluzee.rest.version>1.2.3</kumuluzee.rest.version>
        <hamcrest.version>1.3</hamcrest.version>
        <testng.version>6.9.9</testng.version>
        <kumuluzee-arquillian-container.version>1.1.0</kumuluzee-arquillian-container.version>
        <wiremock.version>2.10.1</wiremock.version>

        <surefire.plugin.version>2.22.1</surefire.plugin.version>
        <wiremock.plugin.version>2.7.0</wiremock.plugin.version>
        <maven-compiler-plugin.version>3.6.1</maven-compiler-plugin.version>
        <nexus.staging.plugin.version>1.6.8</nexus.staging.plugin.version>
        <gpg.plugin.version>1.6</gpg.plugin.version>

        <unused-url>http://104.18.34.92:1234/null</unused-url>
    </properties>

    <scm>
        <connection>scm:git:git@github.com:kumuluz/kumuluzee-rest-client.git</connection>
        <developerConnection>scm:git:git@github.com:kumuluz/kumuluzee-rest-client.git</developerConnection>
        <url>git@github.com:kumuluz/kumuluzee-rest-client.git</url>
    </scm>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/kumuluz/kumuluzee-rest-client/issues</url>
    </issueManagement>

    <developers>
        <developer>
            <name>Tilen Faganel</name>
            <id>tfaga</id>
            <email>tilen.faganel@me.com</email>
            <url>https://github.com/TFaga</url>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

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

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.kumuluz.ee</groupId>
                <artifactId>kumuluzee-bom</artifactId>
                <version>${kumuluzee.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- micro profile -->
        <dependency>
            <groupId>org.eclipse.microprofile.rest.client</groupId>
            <artifactId>microprofile-rest-client-api</artifactId>
            <version>${microprofile.rest-client.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.microprofile.config</groupId>
            <artifactId>microprofile-config-api</artifactId>
            <version>${microprofile.config.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.microprofile.fault-tolerance</groupId>
            <artifactId>microprofile-fault-tolerance-api</artifactId>
            <version>${microprofile.fault-tolerance.version}</version>
        </dependency>
        <!-- kumuluzEE -->
        <dependency>
            <groupId>com.kumuluz.ee</groupId>
            <artifactId>kumuluzee-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.kumuluz.ee</groupId>
            <artifactId>kumuluzee-servlet-jetty</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.kumuluz.ee</groupId>
            <artifactId>kumuluzee-cdi-weld</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.kumuluz.ee</groupId>
            <artifactId>kumuluzee-jax-rs-jersey</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.kumuluz.ee</groupId>
            <artifactId>kumuluzee-json-p-jsonp</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.kumuluz.ee.rest</groupId>
            <artifactId>kumuluzee-rest-core</artifactId>
            <version>${kumuluzee.rest.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-processing</artifactId>
            <version>${jersey-media.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.glassfish</groupId>
                    <artifactId>jakarta.json</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Testing -->
        <dependency>
            <groupId>com.kumuluz.ee.config</groupId>
            <artifactId>kumuluzee-config-mp</artifactId>
            <version>${kumuluzee.config.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.microprofile.rest.client</groupId>
            <artifactId>microprofile-rest-client-tck</artifactId>
            <version>${microprofile.rest-client.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.kumuluz.ee.testing</groupId>
            <artifactId>kumuluzee-arquillian-container</artifactId>
            <version>${kumuluzee-arquillian-container.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.tomakehurst</groupId>
            <artifactId>wiremock</artifactId>
            <version>${wiremock.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus.staging.plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire.plugin.version}</version>
                <configuration>
                    <trimStackTrace>false</trimStackTrace>
                    <suiteXmlFiles>
                        <suiteXmlFile>tck-suite.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <environmentVariables>
                        <KUMULUZEE_RESTCLIENT_DISABLEJETTYWWWAUTH>true</KUMULUZEE_RESTCLIENT_DISABLEJETTYWWWAUTH>
                    </environmentVariables>
                    <systemProperties>
                        <!-- resolved http://microprofile.io:1234/null -->
                        <!-- if not specified in ip form, Jetty retries all DNS entries and the timeout is incorrect -->
                        <org.eclipse.microprofile.rest.client.tck.unusedURL>${unused-url}</org.eclipse.microprofile.rest.client.tck.unusedURL>
                    </systemProperties>
                </configuration>
            </plugin>
            <plugin>
                <groupId>uk.co.deliverymind</groupId>
                <artifactId>wiremock-maven-plugin</artifactId>
                <version>${wiremock.plugin.version}</version>
                <executions>
                    <execution>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <dir>target/classes</dir>
                            <params>--port=8765 --verbose</params>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>deploy</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>uk.co.deliverymind</groupId>
                        <artifactId>wiremock-maven-plugin</artifactId>
                        <version>${wiremock.plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>java9-modules</id>
            <activation>
                <jdk>[9,)</jdk>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>javax.xml.bind</groupId>
                    <artifactId>jaxb-api</artifactId>
                    <version>${jaxb-api.version}</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

</project>