<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.7.21</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>7.9.5</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>

    <!-- Fix CVE-2022-36944 -->
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>2.13.18</version>
    </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-serializer</artifactId>
      <version>${version.schema-registry}</version>
    </dependency>

    <!-- Resolves https://github.com/advisories/GHSA-v2xm-76pq-phcf -->
    <dependency>
      <groupId>io.github.classgraph</groupId>
      <artifactId>classgraph</artifactId>
      <version>4.8.184</version>
    </dependency>

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


    <dependency>
      <groupId>org.xerial.snappy</groupId>
      <artifactId>snappy-java</artifactId>
      <version>${version.snappy-java}</version>
    </dependency>

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

    <dependency>
      <groupId>dev.failsafe</groupId>
      <artifactId>failsafe</artifactId>
    </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>org.skyscreamer</groupId>
      <artifactId>jsonassert</artifactId>
      <scope>test</scope>
    </dependency>

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

  <build>
    <plugins>
      <plugin>
        <groupId>io.camunda.connector</groupId>
        <artifactId>element-template-generator-maven-plugin</artifactId>
        <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>
              </files>
              <generateHybridTemplates>true</generateHybridTemplates>
              <features>
                <INBOUND_DEDUPLICATION>true</INBOUND_DEDUPLICATION>
                <ACKNOWLEDGEMENT_STRATEGY_SELECTION>true</ACKNOWLEDGEMENT_STRATEGY_SELECTION>
              </features>
            </connector>
          </connectors>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
