<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2024 Hazelcast Inc.
  ~
  ~ Licensed under the Hazelcast Community License (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://hazelcast.com/hazelcast-community-license
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES 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>
    <packaging>jar</packaging>
    <name>hazelcast-jet-kafka-connect</name>
    <description>Kafka Connect support for Hazelcast Jet</description>
    <url>http://www.hazelcast.com/</url>

    <artifactId>hazelcast-jet-kafka-connect</artifactId>

    <parent>
        <groupId>com.hazelcast.jet</groupId>
        <artifactId>hazelcast-jet-extensions</artifactId>
        <version>5.5.0</version>
    </parent>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Automatic-Module-Name>com.hazelcast.jet.kafka.connect</Automatic-Module-Name>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-shade-plugin</artifactId>
                <configuration>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/MANIFEST.MF</exclude>
                                <exclude>LICENSE</exclude>
                                <exclude>NOTICE</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.googlecode.maven-download-plugin</groupId>
                <artifactId>download-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>download-datagen-zip-file</id>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>
                                https://repository.hazelcast.com/download/tests/confluentinc-kafka-connect-datagen-0.6.0.zip
                            </url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>download-jdbc-zip-file</id>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>
                                https://repository.hazelcast.com/download/tests/confluentinc-kafka-connect-jdbc-10.6.3.zip
                            </url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>download-couchbase-zip-file</id>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>
                                https://repository.hazelcast.com/download/tests/couchbase-kafka-connect-couchbase-4.1.11.zip
                            </url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>download-ne4j-zip-file</id>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://repository.hazelcast.com/download/tests/neo4j-kafka-connect-neo4j-2.0.1.zip
                            </url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>download-redis-zip-file</id>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://repository.hazelcast.com/download/tests/redis-kafka-connect-0.9.0.zip
                            </url>
                            <unpack>true</unpack>
                            <outputDirectory>${project.build.directory}/</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>download-sqs-jar-file</id>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://repository.hazelcast.com/download/tests/kafka-connect-sqs-1.5.0.jar
                            </url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>download-mongo-jar-file</id>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://repository.hazelcast.com/download/tests/mongo-kafka-connect-1.10.0-all.jar
                            </url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration combine.children="append">
                    <additionalClasspathElements>
                        <additionalClasspathElement>
                            ${project.build.directory}/redis-redis-kafka-connect-0.9.0/lib/redis-kafka-connect-0.9.0-all.jar
                        </additionalClasspathElement>
                    </additionalClasspathElements>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>connect-api</artifactId>
            <version>${kafka.version}</version>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>toxiproxy</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>mysql</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Couchbase-->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>couchbase</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.couchbase.client</groupId>
            <artifactId>java-client</artifactId>
            <version>3.7.0</version>
            <scope>test</scope>
        </dependency>
        <!-- Neo4J-->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>neo4j</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.neo4j.driver</groupId>
            <artifactId>neo4j-java-driver</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Redis-->
        <dependency>
            <groupId>com.redis</groupId>
            <artifactId>testcontainers-redis</artifactId>
            <version>2.0.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.lettuce</groupId>
            <artifactId>lettuce-core</artifactId>
            <version>6.3.2.RELEASE</version>
            <scope>test</scope>
        </dependency>
        <!-- AWS SQS-->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>localstack</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>sqs</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Mongo connector tests -->
        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongodb-driver-sync</artifactId>
            <version>${mongodb.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>mongodb</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
