<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/maven-v4_0_0.xsd">
    <parent>
        <groupId>de.kaufhof.ets</groupId>
        <artifactId>ets-poms-root-parent</artifactId>
        <version>0.6.0</version>
        <relativePath>../ets-poms-root-parent/pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>ets-poms-module-parent</artifactId>
    <packaging>pom</packaging>
    <name>EShop Technology Stack (ETS) - Module Parent POM</name>

    <dependencyManagement>
        <dependencies>

            <!-- scala libs -->
            <dependency>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest_${ets.scala.compat.version}</artifactId>
                <version>${ets.scalatest.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                <version>${ets.scala.version}</version>
            </dependency>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-reflect</artifactId>
                <version>${ets.scala.version}</version>
            </dependency>

            <!-- Akka -->
            <dependency>
                <groupId>com.typesafe.akka</groupId>
                <artifactId>akka-actor_${ets.scala.compat.version}</artifactId>
                <version>${ets.akka.version}</version>
            </dependency>
            <dependency>
                <groupId>com.typesafe.akka</groupId>
                <artifactId>akka-stream_${ets.scala.compat.version}</artifactId>
                <version>${ets.akka.version}</version>
            </dependency>
            <dependency>
                <groupId>com.typesafe.akka</groupId>
                <artifactId>akka-cluster_${ets.scala.compat.version}</artifactId>
                <version>${ets.akka.version}</version>
            </dependency>

            <!-- Akka-Remote:
                 Implicitly pulled some akka-cluster, explicitly mentioned here
                 for dependency exclusion of the unnecessary transports

                 Because of many classpath conflicts with netty we avoid netty
                 whenever possible (without performance issues). Akka remoting offers
                 a new way called artery which ships the aeron transport / can do tcp
                 over akka streams which should be perfectly fine for us.
             -->
            <dependency>
                <groupId>com.typesafe.akka</groupId>
                <artifactId>akka-remote_${ets.scala.compat.version}</artifactId>
                <version>${ets.akka.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>io.netty</groupId>
                        <artifactId>netty</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>com.typesafe.akka</groupId>
                <artifactId>akka-protobuf_${ets.scala.compat.version}</artifactId>
                <version>${ets.akka.version}</version>
            </dependency>

            <dependency>
                <groupId>com.typesafe.akka</groupId>
                <artifactId>akka-http_${ets.scala.compat.version}</artifactId>
                <version>${ets.akka.http.version}</version>
            </dependency>

            <dependency>
                <groupId>com.typesafe.akka</groupId>
                <artifactId>akka-http-spray-json_${ets.scala.compat.version}</artifactId>
                <version>${ets.akka.http.version}</version>
            </dependency>

            <!-- maintained in the akka-http git namespace -->
            <!-- explicitly declared because http and it's libraries are first class -->
            <dependency>
                <groupId>com.typesafe.akka</groupId>
                <artifactId>akka-parsing_${ets.scala.compat.version}</artifactId>
                <version>${ets.akka.http.version}</version>
            </dependency>

            <!-- Transitive dependency of akka-stream -> typesafe-ssl-config, but first class citizen too -->
            <dependency>
                <groupId>org.scala-lang.modules</groupId>
                <artifactId>scala-parser-combinators_${ets.scala.compat.version}</artifactId>
                <version>1.1.0</version><!-- TODO remove versions -->
            </dependency>

            <!--
                Transitive dependency of Akka-Actor, First class Citizen, too
            -->
            <dependency>
                <groupId>com.typesafe</groupId>
                <artifactId>config</artifactId>
                <version>${ets.typesafe.config.version}</version>
            </dependency>

            <dependency>
                <groupId>com.typesafe.akka</groupId>
                <artifactId>akka-persistence-cassandra_${ets.scala.compat.version}</artifactId>
                <version>0.54</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.datastax.cassandra</groupId>
                        <artifactId>cassandra-driver-core</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- Cassandra -->
            <dependency>
                <groupId>com.datastax.cassandra</groupId>
                <artifactId>cassandra-driver-core</artifactId>
                <version>${ets.cassandra.driver.version}</version>
            </dependency>
            <dependency>
                <groupId>com.datastax.cassandra</groupId>
                <artifactId>cassandra-driver-extras</artifactId>
                <version>${ets.cassandra.driver.version}</version>
            </dependency>


            <!-- no third party dependencies <3 -->
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
                <version>${ets.logback.version}</version>
            </dependency>

            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${ets.logback.version}</version>
            </dependency>

            <dependency>
                <groupId>net.logstash.logback</groupId>
                <artifactId>logstash-logback-encoder</artifactId>
                <version>${ets.logstash.logback.encoder.version}</version>
            </dependency>

            <dependency>
                <groupId>com.typesafe.scala-logging</groupId>
                <artifactId>scala-logging_${ets.scala.compat.version}</artifactId>
                <version>${ets.typesafe.scala-logging.version}</version>
            </dependency>

            <dependency>
                <groupId>de.kaufhof.ess.itgr.gts</groupId>
                <artifactId>pillar_${ets.scala.compat.version}</artifactId>
                <version>${ets.pillar.version}</version>
            </dependency>

            <dependency>
                <groupId>io.spray</groupId>
                <artifactId>spray-json_${ets.scala.compat.version}</artifactId>
                <version>${ets.spray.version}</version>
            </dependency>

            <!-- Required at least by the cassandra driver and scala logging, SLF4j is a good logging facade
                 and should be used if you don't use scala-logging directly -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${ets.slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jul-to-slf4j</artifactId>
                <version>${ets.slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${ets.slf4j.version}</version>
            </dependency>

            <!-- Jackson -->
            <!-- Jackson json is used by many libs, therefore it's a first class citizen. We prefer
            the current version (fasterxml). Some libraries depend on the 1.x version (codehaus namespace)
            but we try to avoid the 1.x version.
            -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${ets.fasterxml.jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${ets.fasterxml.jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${ets.fasterxml.jackson.version}</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jdk8</artifactId>
                <version>${ets.fasterxml.jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jsr310</artifactId>
                <version>${ets.fasterxml.jackson.version}</version>
            </dependency>


            <!-- http components -->
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${ets.httpcomponents.httpclient.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpcore</artifactId>
                <version>${ets.httpcomponents.httpcore.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpasyncclient</artifactId>
                <version>${ets.httpcomponents.httpasyncclient.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpcore-nio</artifactId>
                <version>${ets.httpcomponents.httpcore.version}</version>
            </dependency>

            <!-- play json stuff -->
            <dependency>
                <groupId>com.typesafe.play</groupId>
                <artifactId>play-json_${ets.scala.compat.version}</artifactId>
                <version>${ets.playframework.json.version}</version>
            </dependency>
            <dependency>
                <groupId>com.typesafe.play</groupId>
                <artifactId>play-functional_${ets.scala.compat.version}</artifactId>
                <version>${ets.playframework.json.version}</version>
            </dependency>

            <!-- other utils stuff -->
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>${ets.joda-time.version}</version>
            </dependency>

            <dependency>
                <groupId>org.elasticsearch.client</groupId>
                <artifactId>elasticsearch-rest-client</artifactId>
                <version>${ets.elasticsearch.restclient.version}</version>
            </dependency>

            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>${ets.commons.codec.version}</version>
            </dependency>

            <!-- ETS Dependencies -->
            <!-- May contain not (yet) published libraries -->
            <dependency>
                <groupId>de.kaufhof.ets</groupId>
                <artifactId>ets-filestorage-core</artifactId>
                <version>${ets.filestorage.version}</version>
            </dependency>

            <dependency>
                <groupId>de.kaufhof.ets</groupId>
                <artifactId>ets-akka-stream-utils-core</artifactId>
                <version>${ets.akka-stream-utils-core.version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${ets.maven.enforcer.plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-banned-dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <!-- we always use SLF4J and logback but we don't want to exclude
                                    commons-logging in our dependency declaration because then we would provide
                                    and artifact which is broken if you reference it directly (missing dependency,
                                    you may not know that you need the SLF4J bridge there.

                                    Use the org.slf4j:jcl-over-slf4j bridge after removing commons-logging-->

                                    <excludes>
                                        <exclude>commons-logging:commons-logging</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.scalatest</groupId>
                    <artifactId>scalatest-maven-plugin</artifactId>
                    <version>${ets.scalatest.mavenplugin.version}</version>
                    <executions>
                        <execution>
                            <id>test</id>
                            <goals>
                                <goal>test</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- deactivate (junit) tests because we use scalatest -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${ets.maven.surefire.plugin.version}</version>
                    <configuration>
                        <skipTests>true</skipTests>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${ets.maven.compiler.plugin.version}</version>
                    <configuration>
                        <source>${ets.java.version}</source>
                        <target>${ets.java.version}</target>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>scala-maven-plugin</artifactId>
                    <version>${ets.scala.mavenplugin.version}</version>
                    <executions>
                        <execution>
                            <id>scala-compile</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>add-source</goal>
                                <goal>compile</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>scala-test-compile</id>
                            <phase>process-test-resources</phase>
                            <goals>
                                <goal>
                                    testCompile
                                </goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <scalaVersion>${ets.scala.version}</scalaVersion>
                        <scalaCompatVersion>${ets.scala.compat.version}</scalaCompatVersion>
                        <source>${ets.java.version}</source>
                        <target>${ets.java.version}</target>
                        <args>
                            <arg>-feature</arg>
                            <arg>-deprecation</arg>
                            <arg>-language:implicitConversions</arg>
                            <arg>-language:postfixOps</arg>
                        </args>
                        <recompileMode>incremental</recompileMode>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${ets.maven.exec.plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${ets.maven.source.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${ets.maven.javadoc.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${ets.maven.deploy.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${ets.maven.projectinforeports.plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-archetype-plugin</artifactId>
                    <version>${ets.maven.archetype.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${ets.maven.resource.plugin.version}</version>
                    <configuration>
                        <addDefaultExcludes>false</addDefaultExcludes>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${ets.maven.assembly.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <!-- src/main/scala -->
        <profile>
            <id>ets-module-main-scala</id>
            <activation>
                <file>
                    <exists>src/main/scala</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.alchim31.maven</groupId>
                        <artifactId>scala-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.scala-lang</groupId>
                    <artifactId>scala-library</artifactId>
                </dependency>
            </dependencies>
        </profile>

        <!-- src/test/scala -->
        <profile>
            <id>ets-module-test-scala</id>
            <activation>
                <property>
                    <name>maven.test.skip</name>
                    <value>!true</value>
                </property>
                <file>
                    <exists>src/test/scala</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.scalatest</groupId>
                        <artifactId>scalatest-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.scalatest</groupId>
                    <artifactId>scalatest_${ets.scala.compat.version}</artifactId>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

    <!-- We need a SCM declaration in each file because of
        https://issues.apache.org/jira/browse/MNG-3244
        https://issues.apache.org/jira/browse/MNG-2290
    -->
    <scm>
        <url>https://github.com/Galeria-Kaufhof/ets-poms</url>
        <connection>scm:git:git@github.com:Galeria-Kaufhof/ets-poms.git</connection>
        <developerConnection>scm:git:git@github.com:Galeria-Kaufhof/ets-poms.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

</project>
