<?xml version="1.0" encoding="UTF-8"?>
<!--
  SPDX-License-Identifier: Apache-2.0
  Copyright (c) StreamThoughts

  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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.streamthoughts</groupId>
        <artifactId>kafka-connect-filepulse-reactor</artifactId>
        <version>2.14.1</version>
    </parent>

    <artifactId>kafka-connect-filepulse-plugin</artifactId>

    <name>Kafka Connect Source File Pulse Plugin</name>

    <properties>
        <checkstyle.config.location>${project.parent.basedir}</checkstyle.config.location>
        <license.header.file>${project.parent.basedir}/header</license.header.file>
    </properties>

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

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludedGroups>integration</excludedGroups>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <groups>integration</groups>
                    <!-- causes Failsafe to use the compiled classes rather than the repackaged jar -->
                    <classesDirectory>${project.build.outputDirectory}</classesDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.4.0</version>
                <executions>
                    <execution>
                        <id>add-integration-test-source</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/integration-test/java</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-integration-test-resource</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>add-test-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/integration-test/resources</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptors>
                        <descriptor>src/assembly/development.xml</descriptor>
                        <descriptor>src/assembly/package.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-make-assembly</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>4.5.14</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>dist</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.confluent</groupId>
                        <version>${kafka.connect.maven.plugin.version}</version>
                        <artifactId>kafka-connect-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>kafka-connect</goal>
                                </goals>
                                <configuration>
                                    <name>kafka-connect-file-pulse</name>
                                    <title>Kafka Connect File Pulse</title>
                                    <documentationUrl>https://github.com/streamthoughts/kafka-connect-file-pulse</documentationUrl>
                                    <sourceUrl>https://github.com/streamthoughts/kafka-connect-file-pulse</sourceUrl>
                                    <description>
                                        The Kafka Connect FilePulse Connector is a powerful source connector that makes it easy to parse, transform, and load data from the local filesystem, Amazon S3, Azure Blob Storage and Google Cloud Storage. This connector supports a variety of formats equally for all storage systems, e.g., text files, CSV, XML, JSON, Avro, Log4j, etc.
                                    </description>
                                    <supportProviderName>StreamThoughts</supportProviderName>
                                    <supportSummary>This connector is supported by the open source community.</supportSummary>
                                    <supportUrl>https://streamthoughts.io/open-source</supportUrl>

                                    <logo>${project.basedir}/../assets/logo.png</logo>

                                    <ownerUsername>streamthoughts</ownerUsername>
                                    <ownerType>organization</ownerType>
                                    <ownerName>StreamThoughts</ownerName>
                                    <ownerUrl>https://streamthoughts.io/</ownerUrl>

                                    <componentTypes>
                                        <componentType>source</componentType>
                                    </componentTypes>

                                    <tags>
                                        <tag>filesystem</tag>
                                        <tag>files</tag>
                                        <tag>grok</tag>
                                        <tag>parsing</tag>
                                        <tag>log</tag>
                                        <tag>csv</tag>
                                        <tag>xml</tag>
                                        <tag>cloud</tag>
                                        <tag>aws</tag>
                                        <tag>azure</tag>
                                        <tag>gcs</tag>
                                        <tag>sftp</tag>
                                    </tags>

                                    <requirements/>

                                    <deliveryGuarantee>
                                        <deliveryGuarantee>atLeastOnce</deliveryGuarantee>
                                    </deliveryGuarantee>

                                    <confluentControlCenterIntegration>true</confluentControlCenterIntegration>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>standalone</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <configuration>
                            <descriptors>
                                <descriptor>src/assembly/standalone.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>all</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>io.streamthoughts</groupId>
                    <artifactId>kafka-connect-filepulse-amazons3-fs</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>io.streamthoughts</groupId>
                    <artifactId>kafka-connect-filepulse-azure-storage-fs</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>io.streamthoughts</groupId>
                    <artifactId>kafka-connect-filepulse-google-cloud-storage-fs</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>io.streamthoughts</groupId>
                    <artifactId>kafka-connect-filepulse-local-fs</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>io.streamthoughts</groupId>
                    <artifactId>kafka-connect-filepulse-sftp-fs</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>io.streamthoughts</groupId>
                    <artifactId>kafka-connect-filepulse-aliyunoss-fs</artifactId>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>aws</id>
            <dependencies>
                <dependency>
                    <groupId>io.streamthoughts</groupId>
                    <artifactId>kafka-connect-filepulse-amazons3-fs</artifactId>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>gcs</id>
            <dependencies>
                <dependency>
                    <groupId>io.streamthoughts</groupId>
                    <artifactId>kafka-connect-filepulse-google-cloud-storage-fs</artifactId>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>azure</id>
            <dependencies>
                <dependency>
                    <groupId>io.streamthoughts</groupId>
                    <artifactId>kafka-connect-filepulse-azure-storage-fs</artifactId>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>local</id>
            <dependencies>
                <dependency>
                    <groupId>io.streamthoughts</groupId>
                    <artifactId>kafka-connect-filepulse-local-fs</artifactId>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
    <dependencies>
        <dependency>
            <groupId>io.streamthoughts</groupId>
            <artifactId>kafka-connect-filepulse-api</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.streamthoughts</groupId>
            <artifactId>kafka-connect-filepulse-filters</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.jsoniter</groupId>
            <artifactId>jsoniter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>connect-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <!-- START test dependencies-->
        <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>kafka-schema-registry-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>json-path</artifactId>
        </dependency>
        <dependency>
            <groupId>io.streamthoughts</groupId>
            <artifactId>kafka-connect-filepulse-local-fs</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- END test dependencies-->
    </dependencies>

</project>
