<?xml version="1.0" encoding="UTF-8"?>
<!--
    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>
        <!-- This is just for now and will not work if the API has a separate release cycle than the rest. -->
        <groupId>org.eclipse.microprofile.jwt</groupId>
        <artifactId>microprofile-jwt-auth-parent</artifactId>
        <version>1.1.1</version>
    </parent>

    <artifactId>microprofile-jwt-auth-tck</artifactId>
    <version>1.1.1</version>
    <name>MicroProfile JWT Auth TCK Harness</name>
    <description>Eclipse MicroProfile JWT Feature - TCK</description>

    <properties>
        <version.shrinkwrap.resolvers>2.2.6</version.shrinkwrap.resolvers>
        <version.testng>6.10</version.testng>
        <checkstyle.methodNameFormat>^_?[a-z][a-zA-Z0-9_]*$</checkstyle.methodNameFormat>
        <asciidoctor-maven.version>1.5.5</asciidoctor-maven.version>
        <asciidoctorj-pdf.version>1.5.0-alpha.15</asciidoctorj-pdf.version>
        <!-- TCK properties that must be overriden in the vendor profile -->
        <tck.ITokenParserArtifact>INVALID</tck.ITokenParserArtifact>
        <tck.includes>INVALID</tck.includes>
        <tck.testSuite>tck-null-suite.xml</tck.testSuite>
        <tck.redirectTestOutputToFile>false</tck.redirectTestOutputToFile>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.microprofile.jwt</groupId>
            <artifactId>microprofile-jwt-auth-api</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.microprofile.config</groupId>
            <artifactId>microprofile-config-api</artifactId>
            <version>1.2.1</version>
        </dependency>

        <dependency>
            <groupId>javax.json</groupId>
            <artifactId>javax.json-api</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>1.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.security.jacc</groupId>
            <artifactId>javax.security.jacc-api</artifactId>
            <version>1.5</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>javax.ejb</groupId>
            <artifactId>ejb-api</artifactId>
            <version>3.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.nimbusds</groupId>
            <artifactId>nimbus-jose-jwt</artifactId>
            <version>4.23</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.shrinkwrap</groupId>
            <artifactId>shrinkwrap-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${version.testng}</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.container</groupId>
            <artifactId>arquillian-container-spi</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.container</groupId>
            <artifactId>arquillian-container-test-spi</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.testng</groupId>
            <artifactId>arquillian-testng-container</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.shrinkwrap.resolver</groupId>
            <artifactId>shrinkwrap-resolver-depchain</artifactId>
            <version>${version.shrinkwrap.resolvers}</version>
            <type>pom</type>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <version>${asciidoctor-maven.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-pdf</artifactId>
                        <version>${asciidoctorj-pdf.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>generate-pdf-doc</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>pdf</backend>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <sourceDirectory>.</sourceDirectory>
                    <sourceDocumentName>README.adoc</sourceDocumentName>
                    <sourceHighlighter>coderay</sourceHighlighter>
                    <attributes>
                        <license>Apache License v2.0</license>
                    </attributes>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.20</version>
                    <configuration>
                        <redirectTestOutputToFile>${tck.redirectTestOutputToFile}</redirectTestOutputToFile>
                        <suiteXmlFiles>
                            <suiteXmlFile>${tck.testSuite}</suiteXmlFile>
                        </suiteXmlFiles>
                        <environmentVariables>
                        </environmentVariables>
                        <systemPropertyVariables>
                        </systemPropertyVariables>
                        <forkCount>1</forkCount>
                        <reuseForks>false</reuseForks>
                        <trimStackTrace>false</trimStackTrace>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>container</id>
            <properties>
                <tck.testSuite>tck-base-suite.xml</tck.testSuite>
            </properties>
            <dependencies>
                <dependency>
                    <!--
                    These need to be specified as system properties on mvn command line:
                    mvn -Pcontainer -Dtck.container.groupId=org.wildfly.swarm -Dtck.container.artifactId=jwt-auth-tck \
                    -Dtck.container.version=1.0-SNAPSHOT test
                    -->
                    <groupId>${tck.container.groupId}</groupId>
                    <artifactId>${tck.container.artifactId}</artifactId>
                    <version>${tck.container.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>container-full</id>
            <properties>
                <tck.testSuite>tck-full-suite.xml</tck.testSuite>
            </properties>
            <dependencies>
                <dependency>
                    <!--
                    These need to be specified as system properties on mvn command line:
                    mvn -Pcontainer -Dtck.container.groupId=org.wildfly.swarm -Dtck.container.artifactId=jwt-auth-tck \
                    -Dtck.container.version=1.0-SNAPSHOT test
                    -->
                    <groupId>${tck.container.groupId}</groupId>
                    <artifactId>${tck.container.artifactId}</artifactId>
                    <version>${tck.container.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>eclipse-jarsigner</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.eclipse.cbi.maven.plugins</groupId>
                        <artifactId>eclipse-jarsigner-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
