<!--
/*
 * 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>${parent.groupId}</groupId>
    <artifactId>schema-registry-serde</artifactId>
    <name>AWS Glue Schema Registry Serializer Deserializer</name>
    <description>The AWS Glue Schema Registry Serializer/Deserializer enables Java developers to easily integrate
        their Apache Kafka and AWS Kinesis applications with AWS Glue Schema Registry
    </description>
    <url>https://aws.amazon.com/glue</url>
    <version>${parent.version}</version>
    <packaging>jar</packaging>

    <parent>
        <groupId>software.amazon.glue</groupId>
        <artifactId>schema-registry-parent</artifactId>
        <version>1.1.19</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <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>
    <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>
    <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>

    <dependencies>
        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-sts</artifactId>
            <version>${aws.sdk.v1.version}</version>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>sts</artifactId>
            <version>${aws.sdk.v2.version}</version>
        </dependency>
        <dependency>
            <groupId>${parent.groupId}</groupId>
            <artifactId>schema-registry-common</artifactId>
            <version>${parent.version}</version>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>arns</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>com.kjetland</groupId>
            <artifactId>mbknor-jackson-jsonschema_2.12</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>io.github.classgraph</groupId>
                    <artifactId>classgraph</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.github.classgraph</groupId>
            <artifactId>classgraph</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.erosb</groupId>
            <artifactId>everit-json-schema</artifactId>
            <version>1.14.2</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-collections</groupId>
                    <artifactId>commons-collections</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>${protobuf.version}</version>
        </dependency>
	<dependency>
	    <groupId>org.jetbrains.kotlin</groupId>
	    <artifactId>kotlin-stdlib</artifactId>
	    <version>${kotlin.version}</version>
	</dependency>
	<dependency>
	    <groupId>org.jetbrains.kotlin</groupId>
	    <artifactId>kotlin-stdlib-jdk8</artifactId>
	    <version>${kotlin.version}</version>
    	</dependency>
	<dependency>
	    <groupId>org.jetbrains.kotlin</groupId>
	    <artifactId>kotlin-reflect</artifactId>
	    <version>${kotlin.version}</version>
	</dependency>
	<dependency>
	    <groupId>org.jetbrains.kotlin</groupId>
	    <artifactId>kotlin-scripting-compiler-impl-embeddable</artifactId>
	    <version>${kotlin.version}</version>
    	</dependency>
	<dependency>
	    <groupId>org.jetbrains.kotlin</groupId>
	    <artifactId>kotlin-scripting-compiler-embeddable</artifactId>
	    <version>${kotlin.version}</version>
	</dependency>
        <dependency>
            <groupId>com.squareup.okio</groupId>
            <artifactId>okio</artifactId>
            <version>3.4.0</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.okio</groupId>
            <artifactId>okio-fakefilesystem</artifactId>
            <version>3.2.0</version>
        </dependency>
	<dependency>
	    <groupId>org.jetbrains.kotlinx</groupId>
	    <artifactId>kotlinx-serialization-core-jvm</artifactId>
	    <version>1.4.0</version>
	</dependency>
	<dependency>
            <groupId>com.squareup.wire</groupId>
            <artifactId>wire-schema</artifactId>
            <version>${square-wireschema.version}</version>
        </dependency>

        <dependency>
            <groupId>com.squareup.wire</groupId>
            <artifactId>wire-compiler</artifactId>
            <version>${square-wireschema.version}</version>
            <!-- Excluding as the latest version is not present and this is not required -->
            <exclusions>
                <exclusion>
                    <groupId>com.squareup.wire</groupId>
                    <artifactId>wire-grpc-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.charleskorn.kaml</groupId>
                    <artifactId>kaml</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.google.api.grpc/proto-google-common-protos -->
        <dependency>
            <groupId>com.google.api.grpc</groupId>
            <artifactId>proto-google-common-protos</artifactId>
            <version>2.7.4</version>
        </dependency>
        <dependency>
            <groupId>com.google.jimfs</groupId>
            <artifactId>jimfs</artifactId>
            <version>1.1</version>
        </dependency>
        <!-- Used for Proto assertions in tests -->
        <dependency>
            <groupId>com.google.truth.extensions</groupId>
            <artifactId>truth-proto-extension</artifactId>
            <scope>test</scope>
            <version>1.1.3</version>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-commons</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
        </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-collections4</artifactId>
            <version>4.4</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.6.2</version>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>detect</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Generate the test artifacts for sharing the test data -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.xolstice.maven.plugins</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <version>${proto-plugin.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>gencode</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>compile</goal>
                            <goal>test-compile</goal>
                        </goals>
                        <configuration>
                            <protocArtifact>
                                com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
                            </protocArtifact>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dist</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/target/generated-test-sources/protobuf/</directory>
                                    <filtering>false</filtering>
                                    <excludes>
                                    </excludes>
                                </resource>
                            </resources>
                        </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>
