<?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>
        <groupId>com.criteo.java</groupId>
        <artifactId>garmadon</artifactId>
        <version>0.0.1</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>garmadon-readers-common</artifactId>
    <version>0.0.1</version>

    <dependencies>
        <!-- Kafka -->
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <version>${kafka.version}</version>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>

        <!-- Other garmadon modules -->
        <dependency>
            <groupId>com.criteo.java</groupId>
            <artifactId>garmadon-schema</artifactId>
            <version>${garmadon.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                                <configuration>
                                    <minimizeJar>false</minimizeJar>
                                    <createDependencyReducedPom>false</createDependencyReducedPom>
                                    <transformers>
                                        <transformer
                                                implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                            <manifestEntries>
                                                <Main-Class>${mainClass}</Main-Class>
                                            </manifestEntries>
                                        </transformer>
                                        <transformer
                                                implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer">
                                        </transformer>
                                    </transformers>
                                    <artifactSet>
                                        <excludes>
                                            <exclude>log4j:log4j:jar:</exclude>
                                            <exclude>org.slf4j:slf4j-log4j12:jar:</exclude>
                                            <exclude>classworlds:classworlds</exclude>
                                            <exclude>junit:junit</exclude>
                                            <exclude>jmock:*</exclude>
                                            <exclude>*:xml-apis</exclude>
                                            <exclude>org.apache.maven:lib:tests</exclude>
                                        </excludes>
                                    </artifactSet>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <dependencies/>
        </profile>
    </profiles>
</project>