<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.camunda.connector</groupId>
    <artifactId>connectors-parent</artifactId>
    <version>8.9.2</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <name>connector-kafka</name>
  <description>Camunda Kafka Connector</description>
  <artifactId>connector-kafka</artifactId>
  <packaging>jar</packaging>

  <licenses>
    <license>
      <name>Camunda Self-Managed Free Edition license</name>
      <url>https://camunda.com/legal/terms/cloud-terms-and-conditions/camunda-cloud-self-managed-free-edition-terms/</url>
    </license>
    <license>
      <name>Camunda Self-Managed Enterprise Edition license</name>
    </license>
  </licenses>

  <properties>
    <!-- Pins avro version, as jackson-dataformat-avro transitively imports the outdated one -->
    <version.avro>1.12.1</version.avro>
    <version.schema-registry>8.2.0</version.schema-registry>
    <license.inlineheader>Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
under one or more contributor license agreements. Licensed under a proprietary license.
See the License.txt file for more information. You may not use this file
except in compliance with the proprietary license.</license.inlineheader>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.camunda.connector</groupId>
      <artifactId>element-template-generator-annotations</artifactId>
    </dependency>

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

    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-avro</artifactId>
      <version>${version.jackson-bom}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.avro</groupId>
      <artifactId>avro</artifactId>
      <version>${version.avro}</version>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-avro-serializer</artifactId>
      <version>${version.schema-registry}</version>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-json-schema-provider</artifactId>
      <version>${version.schema-registry}</version>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-json-schema-serializer</artifactId>
      <version>${version.schema-registry}</version>
    </dependency>

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

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-text</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jdk8</artifactId>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jsr310</artifactId>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.module</groupId>
      <artifactId>jackson-module-scala_2.13</artifactId>
    </dependency>

    <dependency>
      <groupId>dev.failsafe</groupId>
      <artifactId>failsafe</artifactId>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-schema-serializer</artifactId>
      <version>${version.schema-registry}</version>
    </dependency>

    <dependency>
      <groupId>org.json</groupId>
      <artifactId>json</artifactId>
      <version>${version.json}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers-kafka</artifactId>
      <version>${version.testcontainers}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents.client5</groupId>
      <artifactId>httpclient5</artifactId>
      <version>${version.httpclient5}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents.core5</groupId>
      <artifactId>httpcore5</artifactId>
      <version>${version.httpcore5}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.camunda.connector</groupId>
      <artifactId>connector-test-utils</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.skyscreamer</groupId>
      <artifactId>jsonassert</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>io.camunda.connector</groupId>
        <artifactId>element-template-generator-maven-plugin</artifactId>
        <version>${project.version}</version>
        <configuration>
          <connectors>
            <connector>
              <connectorClass>io.camunda.connector.kafka.outbound.KafkaConnectorFunction</connectorClass>
              <files>
                <file>
                  <templateId>io.camunda.connectors.KAFKA.v1</templateId>
                  <templateFileName>kafka-outbound-connector.json</templateFileName>
                </file>
              </files>
              <generateHybridTemplates>true</generateHybridTemplates>
            </connector>
            <connector>
              <connectorClass>io.camunda.connector.kafka.inbound.KafkaExecutable</connectorClass>
              <files>
                <file>
                  <templateId>io.camunda.connectors.inbound.KAFKA.v1</templateId>
                  <templateFileName>kafka-inbound-connector-start-event.json</templateFileName>
                </file>
                <file>
                  <templateId>io.camunda.connectors.inbound.KafkaMessageStart.v1</templateId>
                  <templateFileName>kafka-inbound-connector-start-message.json</templateFileName>
                </file>
                <file>
                  <templateId>io.camunda.connectors.inbound.KafkaIntermediate.v1</templateId>
                  <templateFileName>kafka-inbound-connector-intermediate.json</templateFileName>
                </file>
                <file>
                  <templateId>io.camunda.connectors.inbound.KafkaBoundary.v1</templateId>
                  <templateFileName>kafka-inbound-connector-boundary.json</templateFileName>
                </file>
                  <file>
                      <templateId>io.camunda.connectors.inbound.KafkaReceive.v1</templateId>
                      <templateFileName>kafka-inbound-connector-receive.json</templateFileName>
                  </file>
              </files>
              <generateHybridTemplates>true</generateHybridTemplates>
              <features>
                <INBOUND_DEDUPLICATION>true</INBOUND_DEDUPLICATION>
                <ACKNOWLEDGEMENT_STRATEGY_SELECTION>true</ACKNOWLEDGEMENT_STRATEGY_SELECTION>
              </features>
            </connector>
          </connectors>
          <versionHistoryEnabled>true</versionHistoryEnabled>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <configuration>
          <ignoredDependencies>
            <ignoredDependency>io.confluent:kafka-schema-serializer</ignoredDependency>
          </ignoredDependencies>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
