<?xml version="1.0" encoding="UTF-8"?>
<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">
    <parent>
        <artifactId>kafka-rest-parent</artifactId>
        <groupId>io.confluent</groupId>
        <version>5.4.1</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>kafka-rest-scala-consumer</artifactId>
    <packaging>jar</packaging>
    <name>kafka-rest-scala-consumer</name>

    <dependencies>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka_${kafka.scala.version}</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>kafka-rest-common</artifactId>
            <version>${project.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>kafka-avro-serializer</artifactId>
            <version>5.4.1</version>
        </dependency>
        <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>kafka-json-serializer</artifactId>
            <version>5.4.1</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <!--
            This is a workaround for IntelliJ which seems to have a problem including junit + hamcrest
            as transitive dependencies of rest-utils-test. mvn properly resolves these, so it may have
            something to do with special junit handling and test scopes since rest-utils-test is not in
            <scope>test</scope>.
        -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- End workaround -->
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka_${kafka.scala.version}</artifactId>
            <version>1.1.0</version>
            <classifier>test</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
                    <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
                    <createDependencyReducedPom>false</createDependencyReducedPom>
                    <minimizeJar>false</minimizeJar>
                    <artifactSet>
                        <includes>
                            <include>org.apache.kafka:kafka_${kafka.scala.version}</include>
                            <include>org.apache.kafka:kafka-clients</include>
                            <include>com.101tec:zkclient</include>
                            <include>io.confluent:kafka-avro-serializer</include>
                            <include>io.confluent:kafka-json-serializer</include>
                        </includes>
                    </artifactSet>
                    <relocations>
                        <relocation>
                            <pattern>kafka</pattern>
                            <shadedPattern>io.confluent.kafka</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>org.apache.kafka</pattern>
                            <shadedPattern>io.confluent.org.apache.kafka</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>io.confluent.kafka.serializers</pattern>
                            <shadedPattern>io.confluent.kafka.shaded.serializers</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>io.confluent.kafka.formatter</pattern>
                            <shadedPattern>io.confluent.kafka.shaded.formatter</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>