<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ /* ******************************************************************************
  ~  *
  ~  *
  ~  * This program and the accompanying materials are made available under the
  ~  * terms of the Apache License, Version 2.0 which is available at
  ~  * https://www.apache.org/licenses/LICENSE-2.0.
  ~  *
  ~  *  See the NOTICE file distributed with this work for additional
  ~  *  information regarding copyright ownership.
  ~  * 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.
  ~  *
  ~  * SPDX-License-Identifier: Apache-2.0
  ~  ******************************************************************************/
  -->

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

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.nd4j</groupId>
        <artifactId>nd4j-serde</artifactId>
        <version>1.0.0-M2.1</version>
    </parent>

    <artifactId>nd4j-kryo_2.12</artifactId>

    <name>nd4j-kryo</name>

    <properties>
        <kryo.version>4.0.2</kryo.version>
        <jkserializers.version>0.41</jkserializers.version>
        <module.name>nd4j.kryo</module.name>
    </properties>

    <build>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.moditect</groupId>
                    <artifactId>moditect-maven-plugin</artifactId>
                    <configuration>
                        <jvmVersion>9</jvmVersion>
                        <overwriteExistingFiles>true</overwriteExistingFiles>
                        <outputDirectory>${project.build.directory}</outputDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <id>generate-module-info</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>generate-module-info</goal>
                            </goals>
                            <configuration>
                                <modules>
                                    <module>
                                        <artifact>
                                            <groupId>${project.groupId}</groupId>
                                            <artifactId>${project.artifactId}</artifactId>
                                            <version>${project.version}</version>
                                        </artifact>

                                        <moduleInfo>
                                            <name>${module.name}</name>
                                            <exports>
                                                *;
                                            </exports>
                                            <open>true</open>
                                        </moduleInfo>

                                    </module>


                                    <module>
                                        <artifact>
                                            <groupId>com.twitter</groupId>
                                            <artifactId>chill_2.12</artifactId>
                                            <version>0.9.3</version>
                                        </artifact>

                                        <moduleInfo>
                                            <name>chill</name>
                                            <exports>
                                                *;
                                            </exports>
                                            <open>true</open>
                                        </moduleInfo>

                                    </module>

                                </modules>
                                <jdepsExtraArgs>
                                    <arg>--ignore-missing-deps</arg>
                                    <arg>--multi-release</arg>
                                    <arg>9</arg>
                                </jdepsExtraArgs>
                                <skip>${moditect.generate.skip}</skip>
                            </configuration>
                        </execution>

                        <execution>
                            <id>add-module-infos</id>
                            <phase>package</phase>
                            <goals>
                                <goal>add-module-info</goal>
                            </goals>
                            <configuration>
                                <modules>
                                    <module>
                                        <file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>
                                        <moduleInfoFile>${project.basedir}/src/main/java9/module-info.java</moduleInfoFile>
                                    </module>
                                </modules>
                                <skip>${moditect.add.skip}</skip>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.moditect</groupId>
                <artifactId>moditect-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <!-- Force Jackson versions to match Spark. This usually only matters for Spark local, not Spark submit -->
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-scala_2.12</artifactId>
                <version>${jackson.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jdk8</artifactId>
                <version>${jackson.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jsr310</artifactId>
                <version>${jackson.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-paranamer</artifactId>
                <version>${jackson.version}</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Kryo serializers for java immutable collections -->
        <dependency>
            <groupId>de.javakaffee</groupId>
            <artifactId>kryo-serializers</artifactId>
            <version>${jkserializers.version}</version>
        </dependency>

        <dependency>
            <groupId>org.nd4j</groupId>
            <artifactId>nd4j-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.nd4j</groupId>
            <artifactId>nd4j-common-tests</artifactId>
        </dependency>

        <dependency>
            <groupId>org.deeplearning4j</groupId>
            <artifactId>resources</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

</project>
