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

    Copyright © 2015 The Gravitee team (http://gravitee.io)

    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>io.gravitee</groupId>
        <artifactId>gravitee-parent</artifactId>
        <version>23.5.0</version>
    </parent>

    <groupId>io.gravitee.resource</groupId>
    <artifactId>gravitee-resource-oauth2-provider-auth0</artifactId>
    <version>1.0.0</version>

    <name>Gravitee.io APIM - Resource - OAuth2 - Auth0</name>
    <description>The resource is defined to validate an access_token generated by Auth0. Validation is performed locally via JWKS since Auth0 does not expose an RFC 7662 introspection endpoint for third-party resource servers.</description>

    <properties>
        <gravitee-apim.version>4.10.0</gravitee-apim.version>
        <gravitee-plugin-common-configurations.version>1.0.0</gravitee-plugin-common-configurations.version>
        <gravitee-plugin-common-configurations-maven-plugin.version>1.0.0</gravitee-plugin-common-configurations-maven-plugin.version>
        <mapstruct.version>1.6.3</mapstruct.version>

        <properties-maven-plugin.version>1.2.1</properties-maven-plugin.version>
        <!-- Property used by the publication job in CI-->
        <publish-folder-path>graviteeio-apim/plugins/resources</publish-folder-path>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Import bom to properly inherit all dependencies -->
            <dependency>
                <groupId>io.gravitee.apim</groupId>
                <artifactId>gravitee-apim-bom</artifactId>
                <version>${gravitee-apim.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Gravitee.io API-->
        <dependency>
            <groupId>io.gravitee.common</groupId>
            <artifactId>gravitee-common</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.gravitee.resource</groupId>
            <artifactId>gravitee-resource-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.gravitee.gateway</groupId>
            <artifactId>gravitee-gateway-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.gravitee.resource</groupId>
            <artifactId>gravitee-resource-oauth2-provider-api</artifactId>
            <!-- Version specified to avoid a breaking change. Once the versions of APIM under 4.12 will not be maintained anymore
                    we can move back to scope provided and remove the version. -->
            <!-- <scope>provided</scope> -->
            <version>1.5.1</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.node</groupId>
            <artifactId>gravitee-node-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.gravitee.node</groupId>
            <artifactId>gravitee-node-container</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.gravitee.plugin</groupId>
            <artifactId>gravitee-plugin-annotation-processors</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.gravitee.el</groupId>
            <artifactId>gravitee-expression-language</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>io.gravitee.plugin</groupId>
            <artifactId>gravitee-plugin-common-configurations</artifactId>
            <version>${gravitee-plugin-common-configurations.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- HTTP client -->
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-core</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Jackson dependencies -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <scope>provided</scope>
            <version>${mapstruct.version}</version>
        </dependency>

        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <scope>provided</scope>
            <version>${mapstruct.version}</version>
        </dependency>

        <!-- Spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- JWT validation (Auth0 tokens are JWTs validated locally via JWKS) -->
        <dependency>
            <groupId>com.nimbusds</groupId>
            <artifactId>nimbus-jose-jwt</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.hibernate.validator</groupId>
            <artifactId>hibernate-validator</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <!-- Unit testing -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk18on</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk18on</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wiremock</groupId>
            <artifactId>wiremock-standalone</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>properties-maven-plugin</artifactId>
                <version>${properties-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <id>load-plugin-properties</id>
                        <goals>
                            <goal>read-project-properties</goal>
                        </goals>
                        <configuration>
                            <files>
                                <file>${project.basedir}/src/main/resources/plugin.properties</file>
                            </files>
                            <quiet>false</quiet>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptors>
                        <descriptor>src/assembly/resource-assembly.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-resource-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>io.gravitee.plugin</groupId>
                <artifactId>gravitee-plugin-common-configurations-maven-plugin</artifactId>
                <version>${gravitee-plugin-common-configurations-maven-plugin.version}</version>
                <configuration>
                    <!-- Filter source artifacts -->
                    <includeArtifacts>
                        <include>io.gravitee.plugin:gravitee-plugin-common-configurations</include>
                    </includeArtifacts>

                    <!-- Files to extract pattern (optional, default: schemas/**/*.json) -->
                    <includeSchemas>
                        <include>schemas/**/schema-form-*.json</include>
                    </includeSchemas>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>common-schema-form-bundle</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
