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

    Copyright Kroxylicious Authors.

    Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0

-->
<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 https://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <packaging>jar</packaging>

    <parent>
        <groupId>io.kroxylicious</groupId>
        <artifactId>kroxylicious-parent</artifactId>
        <version>0.18.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <artifactId>kroxylicious-integration-test-support</artifactId>
    <name>Integration test support</name>
    <description>Support code to simplify writing integration tests for filters</description>

    <dependencies>

        <!-- project dependencies - runtime and compile -->
        <dependency>
            <groupId>io.kroxylicious</groupId>
            <artifactId>kroxylicious-api</artifactId>
        </dependency>
        <dependency>
            <groupId>io.kroxylicious</groupId>
            <artifactId>kroxylicious-runtime</artifactId>
        </dependency>

        <dependency>
            <groupId>io.kroxylicious.testing</groupId>
            <artifactId>testing-api</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.kroxylicious.testing</groupId>
            <artifactId>testing-junit5-extension</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- FIXME: https://github.com/kroxylicious/kroxylicious-junit5-extension/issues/271 - API surface is part of impl module -->
        <dependency>
            <groupId>io.kroxylicious.testing</groupId>
            <artifactId>testing-impl</artifactId>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.hamcrest</groupId>
                    <artifactId>hamcrest-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


        <!-- third party dependencies - runtime and compile -->
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
        </dependency>
        <dependency>
            <groupId>info.schnatterer.moby-names-generator</groupId>
            <artifactId>moby-names-generator</artifactId>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-common</artifactId>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-buffer</artifactId>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport</artifactId>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec-base</artifactId>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-handler</artifactId>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-classes-epoll</artifactId>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-classes-kqueue</artifactId>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-classes-io_uring</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>io.sundr</groupId>
            <artifactId>builder-annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
        </dependency>

        <!-- third party dependencies - test -->

        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-yaml</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jdk8</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j2-impl</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.flipkart.zjsonpatch</groupId>
            <artifactId>zjsonpatch</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka_2.13</artifactId>
            <scope>test</scope>
        </dependency>
        <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.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.opentest4j</groupId>
            <artifactId>opentest4j</artifactId>
            <scope>compile</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <parameters>true</parameters>
                    <proc>full</proc>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>analyze</id>
                        <configuration>
                            <ignoredUnusedDeclaredDependencies>
                                <ignoredUnusedDeclaredDependency>io.sundr:builder-annotations</ignoredUnusedDeclaredDependency>
                                <ignoredUnusedDeclaredDependency>org.apache.logging.log4j:log4j-slf4j2-impl</ignoredUnusedDeclaredDependency>
                            </ignoredUnusedDeclaredDependencies>
                            <ignoredDependencies>
                                <!-- sundrio generates code that depends on jackson annotations/core, so we need compile scoped dependencies to let the generated code compile -->
                                <ignoredDependency>com.fasterxml.jackson.core:jackson-annotations</ignoredDependency>
                                <ignoredDependency>com.fasterxml.jackson.core:jackson-core</ignoredDependency>
                            </ignoredDependencies>
                        </configuration>
                    </execution>
                    <execution>
                        <id>unpack-message-specs</id>
                        <phase>generate-sources</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>io.kroxylicious</groupId>
                <artifactId>kroxylicious-krpc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-request-decoder</id>
                        <goals>
                            <goal>generate-multi</goal>
                        </goals>
                        <phase>process-sources</phase>
                        <configuration>
                            <messageSpecDirectory>${project.build.directory}/message-specs/common/message
                            </messageSpecDirectory>
                            <messageSpecFilter>*{Request,Response}.json</messageSpecFilter>
                            <templateDirectory>${project.basedir}/src/main/templates</templateDirectory>
                            <templateNames>BodyDecoder.ftl</templateNames>
                            <!--suppress UnresolvedMavenProperty -->
                            <outputFilePattern>${templateName}.java</outputFilePattern>
                            <outputPackage>io.kroxylicious.test.codec</outputPackage>
                            <outputDirectory>${project.build.directory}/generated-sources/krpc</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>generate-data-classes</id>
                        <goals>
                            <goal>generate-multi</goal>
                        </goals>
                        <phase>process-sources</phase>
                        <configuration>
                            <messageSpecDirectory>${project.build.directory}/message-specs/common/message
                            </messageSpecDirectory>
                            <messageSpecFilter>*{Request,Response}.json</messageSpecFilter>
                            <templateDirectory>${project.basedir}/src/main/templates</templateDirectory>
                            <templateNames>DataClasses.ftl</templateNames>
                            <!--suppress UnresolvedMavenProperty -->
                            <outputFilePattern>${templateName}.java</outputFilePattern>
                            <outputPackage>io.kroxylicious.test</outputPackage>
                            <outputDirectory>${project.build.directory}/generated-sources/krpc</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <!-- disable for packages containing the sundrio generated classes -->
                    <excludePackageNames>io.kroxylicious.proxy.config:io.kroxylicious.proxy.config.admin</excludePackageNames>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
