<!--
/*
 * Copyright 2020 Amazon.com, Inc. or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>software.amazon.glue</groupId>
    <artifactId>schema-registry-parent</artifactId>
    <version>1.1.19</version>
    <packaging>pom</packaging>
    <name>AWS Glue Schema Registry Library</name>
    <description>The AWS Glue Schema Registry Library for Java enables Java developers to easily integrate their
        data streaming systems with AWS Glue Schema Registry
    </description>
    <url>https://aws.amazon.com/glue</url>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>amazonwebservices</id>
            <organization>Amazon Web Services</organization>
            <organizationUrl>https://aws.amazon.com</organizationUrl>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:https://github.com/aws/aws-glue-schema-registry.git</connection>
        <developerConnection>scm:git:git@github.com:aws/aws-glue-schema-registry.git</developerConnection>
        <url>https://github.com/awslabs/aws-glue-schema-registry.git</url>
    </scm>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://aws.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://aws.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <modules>
        <module>build-tools</module>
        <module>common</module>
        <module>serializer-deserializer</module>
        <module>serializer-deserializer-msk-iam</module>
        <module>kafkastreams-serde</module>
        <module>avro-kafkaconnect-converter</module>
        <module>avro-flink-serde</module>
        <module>examples</module>
        <module>integration-tests</module>
        <module>jsonschema-kafkaconnect-converter</module>
        <module>protobuf-kafkaconnect-converter</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <glue.schema.registry.groupId>software.amazon.glue</glue.schema.registry.groupId>
        <aws.sdk.v2.version>2.22.12</aws.sdk.v2.version>
        <aws.sdk.v1.version>1.12.660</aws.sdk.v1.version>
        <kafka.scala.version>2.12</kafka.scala.version>
        <kafka.version>3.6.1</kafka.version>
        <avro.version>1.11.3</avro.version>
        <mbknor.jsonschema.converter.version>1.0.39</mbknor.jsonschema.converter.version>
        <everit.json.schema.version>1.14.2</everit.json.schema.version>
        <classgraph.version>4.8.120</classgraph.version>
        <commons.compress.version>1.21</commons.compress.version>
        <commons.lang.version>3.8.1</commons.lang.version>
        <jackson.version>2.12.2</jackson.version>
        <!-- Protobuf -->
        <proto-plugin.version>0.6.1</proto-plugin.version>
	<protobuf.version>3.19.6</protobuf.version>
	<kotlin.version>1.7.10</kotlin.version>
        <square-wireschema.version>4.3.0</square-wireschema.version>
        <apicurio-registry.version>2.1.3.Final</apicurio-registry.version>
        <slf4j.version>1.7.30</slf4j.version>
        <log4j.version>2.17.1</log4j.version>
        <jupiter.version>5.6.3</jupiter.version>
        <mockito.version>3.3.3</mockito.version>
        <lombok.version>1.18.26</lombok.version>
        <hamcrest.version>1.1</hamcrest.version>
        <!--  LATEST KCL Does not work with LocalStack yet, remove once new version works -->
        <kinesis.client.version>2.2.9</kinesis.client.version>
        <!--  LATEST KPL will cause integration test failure in Linux environment, update once we find a way to address the issue -->
        <kinesis.producer.version>0.15.8</kinesis.producer.version>
        <junit.platform.commons.version>1.6.2</junit.platform.commons.version>
        <junit.platform.surefire.version>1.3.2</junit.platform.surefire.version>
        <guava.version>32.0.0-jre</guava.version>
        <commons.lang3.version>3.8.1</commons.lang3.version>
        <commons.cli.version>1.2</commons.cli.version>
        <awaitility.version>3.0.0</awaitility.version>
        <protobuf.java.version>3.19.6</protobuf.java.version>
        <localstack.utils>0.2.23</localstack.utils>
        <aws.msk.iam.auth>2.0.3</aws.msk.iam.auth>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>bom</artifactId>
                <version>${aws.sdk.v2.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>glue</artifactId>
                <version>${aws.sdk.v2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>kafka_${kafka.scala.version}</artifactId>
                <version>${kafka.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>kafka-clients</artifactId>
                <version>${kafka.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>kafka-streams</artifactId>
                <version>${kafka.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>connect-api</artifactId>
                <version>${kafka.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>connect-json</artifactId>
                <version>${kafka.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.avro</groupId>
                <artifactId>avro</artifactId>
                <version>${avro.version}</version>
            </dependency>
            <!-- Temporarily adding dependency on a transitive dependency to fix security bug in underlying library. Remove when dependency is upgraded. -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-compress</artifactId>
                <version>${commons.compress.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.avro</groupId>
                <artifactId>avro-maven-plugin</artifactId>
                <version>${avro.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.avro</groupId>
                <artifactId>avro-compiler</artifactId>
                <version>${avro.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.avro</groupId>
                <artifactId>avro-ipc</artifactId>
                <version>${avro.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-1.2-api</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons.lang.version}</version>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.kjetland</groupId>
                <artifactId>mbknor-jackson-jsonschema_${kafka.scala.version}</artifactId>
                <version>${mbknor.jsonschema.converter.version}</version>
            </dependency>
            <!-- Temporarily adding dependency on a transitive dependency to fix security bug in underlying library. Remove when dependency is upgraded. -->
            <dependency>
                <groupId>io.github.classgraph</groupId>
                <artifactId>classgraph</artifactId>
                <version>${classgraph.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.erosb</groupId>
                <artifactId>everit-json-schema</artifactId>
                <version>${everit.json.schema.version}</version>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>aws-java-sdk-kinesis</artifactId>
                <version>${aws.sdk.v1.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-cbor</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-cli</groupId>
                <artifactId>commons-cli</artifactId>
                <version>${commons.cli.version}</version>
            </dependency>
            <dependency>
                <groupId>cloud.localstack</groupId>
                <artifactId>localstack-utils</artifactId>
                <version>${localstack.utils}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>software.amazon.kinesis</groupId>
                <artifactId>amazon-kinesis-client</artifactId>
                <version>${kinesis.client.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.amazonaws</groupId>
                <artifactId>amazon-kinesis-producer</artifactId>
                <version>${kinesis.producer.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                    <groupId>software.amazon.ion</groupId>
                    <artifactId>ion-java</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>${awaitility.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-commons</artifactId>
                <version>${junit.platform.commons.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-surefire-provider</artifactId>
                <version>${junit.platform.surefire.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>${hamcrest.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>${protobuf.java.version}</version>
            </dependency>
            <!-- Temporarily adding dependency on a transitive dependency to fix security bug in underlying library. Remove when dependency is upgraded. -->
            <dependency>
                <groupId>org.json</groupId>
                <artifactId>json</artifactId>
                <version>20231013</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <runOrder>alphabetical</runOrder>
                    <excludes>
                        <exclude>**/*IntegrationTest</exclude>
                    </excludes>
                </configuration>
                <version>2.22.1</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.1.2</version>
                <configuration>
                    <excludes>**/apicurio/**, **/additionalTypes/**, **/metadata/**</excludes>
                    <suppressionsFileExpression>checkstyle.suppression.filter</suppressionsFileExpression>
                    <configLocation>${user.dir}/build-tools/src/main/resources/checkstyle.xml
                    </configLocation>
                    <suppressionsLocation>${user.dir}/build-tools/src/main/resources/suppressions.xml
                    </suppressionsLocation>
                    <encoding>UTF-8</encoding>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <linkXRef>false</linkXRef>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <excludePackageNames>*.avrodata, *.apicurio</excludePackageNames>
                    <source>8</source>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.8</version>
                <configuration>
                    <excludes>
                        <!-- Ignore exception classes -->
                        <exclude>**/GlueSchemaRegistryIncompatibleDataException*</exclude>
                        <exclude>**/AWSSchemaRegistryException*</exclude>
                        <exclude>**/AWSSchemaNamingStrategy*</exclude>
                        <exclude>**/JsonSchemaDataConfig*</exclude>
                        <exclude>**/JsonSchemaConverterConstants*</exclude>
                        <exclude>**/apicurio/**</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jacoco-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <rule>
                                    <element>PACKAGE</element>
                                    <limits>
                                        <limit>
                                            <counter>INSTRUCTION</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.85</minimum>
                                        </limit>
                                    </limits>
                                    <excludes>
                                        <exclude>com.amazonaws.services.schemaregistry.kafkaconnect.avrodata</exclude>
                                        <exclude>
                                            com.amazonaws.services.schemaregistry.kafkaconnect.AWSKafkaAvroConverterConfig
                                        </exclude>
                                        <exclude>org.apache.avro</exclude>
                                        <exclude>metadata</exclude>
                                        <exclude>additionalTypes</exclude>
                                    </excludes>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>publishing</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>sonatype-nexus-staging</serverId>
                            <nexusUrl>https://aws.oss.sonatype.org</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
