<?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:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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.apim.gateway.standalone</groupId>
        <artifactId>gravitee-apim-gateway-standalone</artifactId>
        <version>4.10.3</version>
    </parent>

    <artifactId>gravitee-apim-gateway-standalone-container</artifactId>
    <name>Gravitee.io APIM - Gateway - Standalone - Container</name>

    <dependencies>
        <!-- Gravitee.io -->
        <dependency>
            <groupId>io.gravitee.node</groupId>
            <artifactId>gravitee-node-api</artifactId>
        </dependency>

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

        <dependency>
            <groupId>io.gravitee.node</groupId>
            <artifactId>gravitee-node-kubernetes</artifactId>
        </dependency>

        <dependency>
            <groupId>io.gravitee.node</groupId>
            <artifactId>gravitee-node-license</artifactId>
        </dependency>

        <dependency>
            <groupId>io.gravitee.node</groupId>
            <artifactId>gravitee-node-vertx</artifactId>
        </dependency>

        <dependency>
            <groupId>io.gravitee.apim.common</groupId>
            <artifactId>gravitee-apim-common</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.plugin</groupId>
            <artifactId>gravitee-plugin-common-configurations</artifactId>
        </dependency>

        <dependency>
            <groupId>io.gravitee.apim.gateway</groupId>
            <artifactId>gravitee-apim-gateway-reactor</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.apim.gateway.handlers</groupId>
            <artifactId>gravitee-apim-gateway-handlers-api</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.apim.gateway.handlers</groupId>
            <artifactId>gravitee-apim-gateway-handlers-shared-policy-group</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.apim.gateway</groupId>
            <artifactId>gravitee-apim-gateway-platform</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.apim.gateway</groupId>
            <artifactId>gravitee-apim-gateway-env</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.apim.gateway</groupId>
            <artifactId>gravitee-apim-gateway-repository</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.apim.gateway</groupId>
            <artifactId>gravitee-apim-gateway-dictionary</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.apim.gateway</groupId>
            <artifactId>gravitee-apim-gateway-opentelemetry</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.apim.gateway</groupId>
            <artifactId>gravitee-apim-gateway-reporting</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.apim.gateway</groupId>
            <artifactId>gravitee-apim-gateway-connector</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.apim.plugin.reactor</groupId>
            <artifactId>gravitee-apim-plugin-reactor-handler</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.apim.definition</groupId>
            <artifactId>gravitee-apim-definition-jackson</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.gravitee.plugin</groupId>
            <artifactId>gravitee-plugin-alert</artifactId>
        </dependency>

        <dependency>
            <groupId>io.gravitee.plugin</groupId>
            <artifactId>gravitee-plugin-service-discovery</artifactId>
        </dependency>

        <dependency>
            <groupId>io.gravitee.resource</groupId>
            <artifactId>gravitee-resource-oauth2-provider-api</artifactId>
        </dependency>

        <dependency>
            <groupId>io.gravitee.resource</groupId>
            <artifactId>gravitee-resource-auth-provider</artifactId>
        </dependency>

        <dependency>
            <groupId>io.gravitee.resource</groupId>
            <artifactId>gravitee-resource-cache-provider-api</artifactId>
        </dependency>

        <dependency>
            <groupId>io.gravitee.resource</groupId>
            <artifactId>gravitee-resource-content-provider-api</artifactId>
        </dependency>

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

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

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <scope>compile</scope>
        </dependency>

        <!-- Vert.x -->
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-core</artifactId>
        </dependency>

        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-web-client</artifactId>
        </dependency>

        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-rx-java3</artifactId>
        </dependency>
        
        <!-- As vertx-rx-java3 makes use of vertx-auth-jwt, it must be included to avoid classpath issue when auth-jwt is used -->
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-auth-jwt</artifactId>
        </dependency>

        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec-haproxy</artifactId>
        </dependency>

        <dependency>
            <groupId>io.projectreactor</groupId>
            <artifactId>reactor-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.projectreactor.addons</groupId>
            <artifactId>reactor-adapter</artifactId>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback.contrib</groupId>
            <artifactId>logback-jackson</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback.contrib</groupId>
            <artifactId>logback-json-classic</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback.contrib</groupId>
            <artifactId>logback-json-core</artifactId>
            <scope>compile</scope>
        </dependency>

        <!-- Kafka -->
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-metadata</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-server-common</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

        <!--
            Validator dependency for @ConfigurationEvaluator annotation processor (link to ARCHI-228)
            This avoids to add this dependency in each plugin using it
        -->
        <dependency>
            <groupId>org.hibernate.validator</groupId>
            <artifactId>hibernate-validator</artifactId>
        </dependency>

        <!-- Spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
        </dependency>
        <dependency>
            <groupId>io.gravitee.connector</groupId>
            <artifactId>gravitee-connector-http</artifactId>
            <version>${gravitee-connector-http.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.gravitee.node</groupId>
            <artifactId>gravitee-node-cluster-plugin-standalone</artifactId>
            <version>${gravitee-node.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.gravitee.node</groupId>
            <artifactId>gravitee-node-cache-plugin-standalone</artifactId>
            <version>${gravitee-node.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Unit Tests -->
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>fluent-hc</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-unit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-junit5-rx-java3</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.activation</groupId>
            <artifactId>jakarta.activation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
        </dependency>

        <!-- 'javax' libraries may still be used by third party libraries. Spring 6 has migrated to jakarta but keeps detecting javax annotation. For that, the library must be present in the classpath.
        (see https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x)-->
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
        </dependency>

        <!-- wiremock is late on jetty have to use its internal version to avoid classloading issues-->
        <dependency>
            <groupId>org.wiremock</groupId>
            <artifactId>wiremock-standalone</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Mapstruct -->
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>

    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <environmentVariables>
                        <gravitee.http.instances>1</gravitee.http.instances>
                    </environmentVariables>
                </configuration>
                <executions>
                    <execution>
                        <!-- default-test is the default execution. But it is already covered by `emulate-v4-engine-test` execution -->
                        <id>default-test</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>v3-engine-test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <reportsDirectory>${project.build.directory}/surefire-reports-v3-engine</reportsDirectory>
                            <environmentVariables>
                                <gravitee.api.v2.emulateV4Engine.default>no</gravitee.api.v2.emulateV4Engine.default>
                            </environmentVariables>
                        </configuration>
                    </execution>
                    <execution>
                        <id>emulate-v4-engine-test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <reportsDirectory>${project.build.directory}/surefire-reports-emulate-v4-engine</reportsDirectory>
                            <environmentVariables>
                                <gravitee.api.v2.emulateV4Engine.default>yes</gravitee.api.v2.emulateV4Engine.default>
                            </environmentVariables>
                            <excludes>
                                <!-- TODO: https://github.com/gravitee-io/issues/issues/8075 -->
                                <exclude>**/ClientConnectionResponseTemplateTest.java</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>java8</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <dependencies>
                <!--
                This is required because of JDK issue: https://bugs.openjdk.java.net/browse/JDK-8152174
                -->
                <dependency>
                    <groupId>io.vertx</groupId>
                    <artifactId>vertx-codegen</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>bundle-default</id>
            <activation>
                <property>
                    <name>bundle</name>
                </property>
            </activation>
            <dependencies>
                <!-- Cloud -->
                <dependency>
                    <groupId>com.graviteesource.cloud</groupId>
                    <artifactId>gravitee-cloud-initializer</artifactId>
                </dependency>

                <dependency>
                    <groupId>com.graviteesource.common</groupId>
                    <artifactId>gravitee-common-mcp</artifactId>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

</project>
