<?xml version="1.0" encoding="UTF-8"?>

<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~ Copyright (c) 2015-2018 Skymind, Inc.
  ~
  ~ 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.
  ~
  ~ 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>

    <groupId>org.deeplearning4j</groupId>
    <artifactId>deeplearning4j</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <name>deeplearning4j</name>
    <description>Deeplearning4j Monorepo</description>
    <url>http://deeplearning4j.org/</url>

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

    <developers>
        <developer>
            <id>agibsonccc</id>
            <name>Adam Gibson</name>
            <email>adam@skymind.io</email>
        </developer>
        <developer>
            <id>chrisvnicholson</id>
            <name>Chris Nicholson</name>
            <email>chris@skymind.io</email>
        </developer>
        <developer>
            <id>jpatanooga</id>
            <name>Josh Patterson</name>
        </developer>
        <developer>
            <id>AlexDBlack</id>
            <name>Alex Black</name>
        </developer>
        <developer>
            <id>nyghtowl</id>
            <name>Melanie Warrick</name>
        </developer>
        <developer>
            <id>raver119</id>
            <name>raver119</name>
        </developer>
        <developer>
            <id>saudet</id>
            <name>Samuel Audet</name>
        </developer>
        <developer>
            <id>eraly</id>
            <name>Susan Eraly</name>
        </developer>
        <developer>
            <id>kepricon</id>
            <name>Daehyun Kim</name>
        </developer>
        <developer>
            <id>turambar</id>
            <name>Dave kale</name>
        </developer>
        <developer>
            <id>maxpumperla</id>
            <name>Max Pumperla</name>
        </developer>
        <!--current & previous core contributors and company developers-->
        <developer>
            <id>rubenfiszel</id>
            <name>Ruben Fiszel</name>
        </developer>
        <developer>
            <id>smarthi</id>
            <name>Suneel Marthi</name>
        </developer>
        <developer>
            <id>taisukeoe</id>
            <name>Taisuke Oe</name>
        </developer>
        <developer>
            <id>treo</id>
            <name>Paul Dubs</name>
        </developer>
        <developer>
            <id>EronWright</id>
            <name>Eron Wright</name>
        </developer>
        <developer>
            <id>jyt109</id>
            <name>Jeffrey Tang</name>
        </developer>
        <developer>
            <id>sonaliii</id>
            <name>Sonali Dayal</name>
        </developer>
        <developer>
            <id>emmjaykay</id>
            <name>emmjaykay</name>
        </developer>
        <developer>
            <id>crockpotveggies</id>
            <name>Justin Long</name>
        </developer>
    </developers>

    <modules>
        <module>libnd4j</module>
        <module>nd4j</module>
        <module>datavec</module>
        <module>deeplearning4j</module>
        <module>arbiter</module>
        <module>nd4s</module>
        <module>rl4j</module>
        <module>scalnet</module>
        <module>jumpy</module>
        <module>pydatavec</module>
        <module>pydl4j</module>
    </modules>

    <scm>
        <connection>scm:git://github.com:deeplearning4j/deeplearning4j.git</connection>
        <developerConnection>scm:git:git@github.com:deeplearning4j/deeplearning4j.git
        </developerConnection>
        <url>git@github.com:deeplearning4j/deeplearning4j.git</url>
        <tag>HEAD</tag>
    </scm>

    <repositories>
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>  <!-- Optional, update daily -->
            </snapshots>
        </repository>
        <repository>
            <id>maven-restlet</id>
            <name>Public online Restlet repository</name>
            <url>http://maven.restlet.org</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>  <!-- Optional, update daily -->
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>  <!-- Optional, update daily -->
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>maven-restlet</id>
            <name>Public online Restlet repository</name>
            <url>http://maven.restlet.org</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>  <!-- Optional, update daily -->
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <distributionManagement>
        <repository>
            <id>sonatype-nexus-releases</id>
            <name>Nexus Release Repository</name>
            <url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus snapshot repository</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <maven.compiler.testTarget>1.8</maven.compiler.testTarget>
        <maven.compiler.testSource>1.8</maven.compiler.testSource>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <deeplearning4j.version>1.0.0-SNAPSHOT</deeplearning4j.version>
        <dl4j.version>1.0.0-SNAPSHOT</dl4j.version>
        <nd4j.version>1.0.0-SNAPSHOT</nd4j.version>
        <datavec.version>1.0.0-SNAPSHOT</datavec.version>
        <dl4j-test-resources.version>1.0.0-SNAPSHOT</dl4j-test-resources.version>
        <dl4j-test-resources.classifier></dl4j-test-resources.classifier>

        <jackson-asl.version>1.9.13</jackson-asl.version>
        <asm.version>5.1</asm.version>
        <arrow.version>0.11.0</arrow.version>
        <avro.version>1.7.7</avro.version>
        <curator.version>2.8.0</curator.version>
        <guice.version>4.0</guice.version>
        <hibernate.version>5.1.3.Final</hibernate.version>
        <hppc.version>0.8.1</hppc.version>
        <httpclient.version>4.5.3</httpclient.version>
        <httpcore.version>4.4.6</httpcore.version>
        <httpmime.version>4.5.3</httpmime.version>
        <janino.version>2.7.8</janino.version>
        <javassist.version>3.19.0-GA</javassist.version>
        <jaxb.version>2.2.11</jaxb.version>
        <jets3t.version>0.7.1</jets3t.version>
        <jetty.version>9.4.10.v20180503</jetty.version>
        <jersey.version>2.29</jersey.version>
        <jsch.version>0.1.51</jsch.version>
        <leveldb.version>1.8</leveldb.version>
        <lz4.version>1.3.0</lz4.version>
        <metrics.version>3.2.6</metrics.version>
        <netty.version>3.10.4.Final</netty.version>
        <objenesis.version>2.6</objenesis.version>
        <paranamer.version>2.6</paranamer.version>
        <ws.rs.version>2.0</ws.rs.version>
        <servlet.version>3.1.0</servlet.version>
        <snakeyaml.version>1.12</snakeyaml.version>
        <snappy.version>1.1.2.6</snappy.version>
        <spring.version>5.1.1.RELEASE</spring.version>
        <t-digest.version>3.2</t-digest.version>

        <oshi.version>3.4.2</oshi.version>
        <kafka.version>0.8.2.2</kafka.version>
        <typesafe.config.version>1.3.0</typesafe.config.version>
        <py4j.version>0.10.4</py4j.version>
        <jcommander.version>1.27</jcommander.version>
        <dropwizard.version>0.8.0</dropwizard.version>
        <jodatime.version>2.2</jodatime.version>
        <protonpack.version>1.15</protonpack.version>
        <poi.version>3.17</poi.version>
        <jodah.typetools.version>0.5.0</jodah.typetools.version>
        <freemarker.version>2.3.23</freemarker.version>
        <geoip2.version>2.8.1</geoip2.version>
        <stream.analytics.version>2.7.0</stream.analytics.version>
        <opencsv.version>2.3</opencsv.version>
        <tdigest.version>3.2</tdigest.version>
        <jtransforms.version>3.1</jtransforms.version>
        <fastutil.version>6.5.7</fastutil.version>
        <unirest.version>1.4.9</unirest.version>
        <reflections.version>0.9.10</reflections.version>
        <breeze.version>1.0</breeze.version>

        <javacpp.parser.skip>false</javacpp.parser.skip>     <!-- To skip header file parsing phase: -Djavacpp.parser.skip=true  -->
        <javacpp.compiler.skip>false</javacpp.compiler.skip> <!-- To skip native compilation phase: -Djavacpp.compiler.skip=true -->
        <javacpp.platform.root/>      <!-- -Djavacpp.platform.root=/path/to/android-ndk/ -->
        <javacpp.platform.compiler/>  <!-- -Djavacpp.platform.compiler=/path/to/arm-linux-androideabi-g++ -->
        <javacpp.platform.sysroot/>   <!-- -Djavacpp.platform.sysroot=$(xcrun -sdk iphoneos -show-sdk-path) -->
        <javacpp.platform.extension/> <!-- -Djavacpp.platform.extension=-avx512 -->
        <javacpp.platform.properties>${javacpp.platform}</javacpp.platform.properties>

        <javacpp.version>1.5.3-SNAPSHOT</javacpp.version>
        <javacpp-presets.version>1.5.3-SNAPSHOT</javacpp-presets.version>
        <javacv.version>1.5.3-SNAPSHOT</javacv.version>

        <python.version>3.7.6</python.version>
        <cpython-platform.version>${python.version}-${javacpp-presets.version}</cpython-platform.version>
        <numpy.version>1.18.1</numpy.version>
        <numpy.javacpp.version>${numpy.version}-${javacpp-presets.version}</numpy.javacpp.version>

        <openblas.version>0.3.9</openblas.version>
        <mkl.version>2020.0</mkl.version>
        <opencv.version>4.2.0</opencv.version>
        <ffmpeg.version>4.2.2</ffmpeg.version>
        <leptonica.version>1.79.0</leptonica.version>
        <hdf5.version>1.12.0</hdf5.version>
        <ale.version>0.6.1</ale.version>
        <gym.version>0.17.1</gym.version>
        <tensorflow.version>1.15.2</tensorflow.version>
        <tensorflow.javacpp.version>${tensorflow.version}-${javacpp-presets.version}</tensorflow.javacpp.version>

        <commons-compress.version>1.18</commons-compress.version>
        <commonsmath.version>3.5</commonsmath.version>
        <commonslang.version>3.6</commonslang.version>
        <commonsio.version>2.5</commonsio.version>
        <commons-codec.version>1.10</commons-codec.version>
        <commons.math.version>${commonsmath.version}</commons.math.version>
        <commons.lang.version>${commonslang.version}</commons.lang.version>
        <commons.io.version>${commonsio.version}</commons.io.version>
        <commons-math3.version>${commonsmath.version}</commons-math3.version>
        <commons-lang.version>2.6</commons-lang.version>
        <commons-lang3.version>${commonslang.version}</commons-lang3.version>
        <commons-logging.version>1.2</commons-logging.version>
        <commons-net.version>3.1</commons-net.version>
        <commons-io.version>${commonsio.version}</commons-io.version>
        <commons-collections.version>3.2.2</commons-collections.version>
        <commons-collections4.version>4.1</commons-collections4.version>

        <spark.version>2.4.3</spark.version>
        <spark.major.version>2</spark.major.version>
        <args4j.version>2.0.29</args4j.version>
        <slf4j.version>1.7.21</slf4j.version>
        <junit.version>4.12</junit.version>
        <logback.version>1.2.3</logback.version>
        <jackson.version>2.10.1</jackson.version>
        <jackson.databind.version>2.10.1</jackson.databind.version>
        <shaded.snakeyaml.version>1.24</shaded.snakeyaml.version>
        <geo.jackson.version>2.8.7</geo.jackson.version>
        <lombok.version>1.18.12</lombok.version>
        <cleartk.version>2.0.0</cleartk.version>
        <lucene-solr.version>7.7.1</lucene-solr.version>
        <json.version>20131018</json.version>
        <google.protobuf.version>2.6.1</google.protobuf.version>
        <failIfNoTests>false</failIfNoTests>
        <hadoop.version>2.2.0</hadoop.version>  <!-- Hadoop version used by Spark 1.6.3 and 2.2.1 (and likely others) -->
        <camel.version>2.16.3</camel.version>
        <zookeeper.version>3.4.6</zookeeper.version>
        <agrona.version>0.5.4</agrona.version>
        <mapdb.version>3.0.5</mapdb.version>
        <sqlite.version>3.15.1</sqlite.version>
        <playframework.version>2.7.3</playframework.version>    <!-- 2.7.3 has Scala 2.11, 2.12 and 2.13 support only (no 2.10) -->
        <javax.ws.rs.version>2.0</javax.ws.rs.version>
        <guava.version>28.0-jre</guava.version>
        <gson.version>2.8.0</gson.version>
        <fbs.version>1.2.0-3f79e055</fbs.version>
        <threadly.version>4.10.0</threadly.version>
        <vertx.version>3.8.3</vertx.version>

        <flatbuffers.version>1.10.0</flatbuffers.version>
        <grpc.version>1.14.0</grpc.version>
        <javax.version>1.2</javax.version>
        <jaxb.version>2.3.0</jaxb.version>

        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
        <maven-scala-plugin.version>3.3.1</maven-scala-plugin.version>
        <maven-resources-plugin.version>3.0.1</maven-resources-plugin.version>
        <sbt-compiler-maven-plugin.version>1.0.0-beta8</sbt-compiler-maven-plugin.version>
        <maven-git-commit-plugin.version>2.2.2</maven-git-commit-plugin.version>
        <maven-git-commit-id-plugin.version>${maven-git-commit-plugin.version}
        </maven-git-commit-id-plugin.version>
        <maven-build-helper-plugin.version>3.0.0</maven-build-helper-plugin.version>
        <maven-play2-plugin.version>1.0.0-beta5</maven-play2-plugin.version>
        <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
        <maven-surefire.version>${maven-surefire-plugin.version}</maven-surefire.version>
        <maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>
        <maven-lint-plugin.version>0.0.11</maven-lint-plugin.version>
        <maven-formatter-plugin.version>2.0.0</maven-formatter-plugin.version>
        <maven-lifecycle-mapping-plugin.version>1.0.0</maven-lifecycle-mapping-plugin.version>
        <maven-lifecycle-mapping.version>${maven-lifecycle-mapping-plugin.version}
        </maven-lifecycle-mapping.version>
        <maven-shade-plugin.version>3.2.1</maven-shade-plugin.version>
        <maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
        <mockito.version>2.2.6</mockito.version>

        <!-- base versions -->
        <!-- Scala 2.11.x -->
        <scala211.version>2.11.12</scala211.version>
        <scala211.binary.version>2.11</scala211.binary.version>
        <!-- Scala 2.12.x -->
        <scala212.version>2.12.9</scala212.version>
        <scala212.binary.version>2.12</scala212.binary.version>

        <scalatest.version>3.0.5</scalatest.version>
        <scalafmt.version>1.3.0</scalafmt.version>
        <scalacheck.version>1.14.0</scalacheck.version>

        <libnd4j.tests>--tests</libnd4j.tests>
        <libnd4j.test.skip>false</libnd4j.test.skip>
        <jumpy.test.skip>false</jumpy.test.skip>
        <pydatavec.test.skip>false</pydatavec.test.skip>
        <pydl4j.test.skip>false</pydl4j.test.skip>
        <skipBackendChoice>false</skipBackendChoice>
        <skipTestResourceEnforcement>false
        </skipTestResourceEnforcement> <!-- Test resource profile must be enabled unless using -DskipTests etc -->
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4.1</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.3</version>
                                    <message>Please install maven 3.3 or higher</message>
                                </requireMavenVersion>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>org.projectlombok:*:*:*:compile</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>doclint-java8-disable</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <doclint>none</doclint>
                            <failOnError>false</failOnError>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sonatype-nexus</id>
            <activation>
                <property>
                    <name>local.software.repository</name>
                    <value>sonatype</value>
                </property>
            </activation>
            <distributionManagement>
                <repository>
                    <id>sonatype-nexus-releases</id>
                    <name>Nexus Release Repository</name>
                    <url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
                <snapshotRepository>
                    <id>sonatype-nexus-snapshots</id>
                    <name>Sonatype Nexus snapshot repository</name>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <version>${maven-deploy-plugin.version}</version>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.6</version>
                        <executions>
                            <execution>
                                <id>default-deploy</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>deploy</goal>
                                </goals>
                            </execution>
                        </executions>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>sonatype-nexus-snapshots</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <skipStagingRepositoryClose>true</skipStagingRepositoryClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- This controls skipping the test backend choice enforcement below -->
        <profile>
            <id>skipTestCompileAndRun</id>
            <activation>
                <property>
                    <name>maven.test.skip</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <libnd4j.tests></libnd4j.tests>
                <libnd4j.test.skip>true</libnd4j.test.skip>
                <jumpy.test.skip>true</jumpy.test.skip>
                <pydatavec.test.skip>true</pydatavec.test.skip>
                <pydl4j.test.skip>true</pydl4j.test.skip>
                <skipBackendChoice>true</skipBackendChoice>
                <skipTestResourceEnforcement>true</skipTestResourceEnforcement>
            </properties>
        </profile>
        <profile>
            <id>skipTestRun</id>
            <activation>
                <property>
                    <name>skipTests</name>
                </property>
            </activation>
            <properties>
                <libnd4j.tests></libnd4j.tests>
                <libnd4j.test.skip>true</libnd4j.test.skip>
                <jumpy.test.skip>true</jumpy.test.skip>
                <pydatavec.test.skip>true</pydatavec.test.skip>
                <pydl4j.test.skip>true</pydl4j.test.skip>
                <skipBackendChoice>true</skipBackendChoice>
                <skipTestResourceEnforcement>true</skipTestResourceEnforcement>
            </properties>
        </profile>
        <!-- end of backend choice enforcement control -->

        <!--
        testresources profile must be running when executing tests. However, maven enforcer plugin seems to be unable
         to enforce only when actually running tests - so we'll skip the enforcement (using profiles skipTestRun and skipTestCompileAndRun)
         when -DskipTests or -Dmaven.test.skip=true is used
         -->
        <profile>
            <id>testresources</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.deeplearning4j</groupId>
                    <artifactId>dl4j-test-resources</artifactId>
                    <version>${dl4j-test-resources.version}</version>
                    <classifier>${dl4j-test-resources.classifier}</classifier>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>qa</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>2.10</version>
                        <executions>
                            <execution>
                                <phase>install</phase>
                                <goals>
                                    <goal>copy-dependencies</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/lib
                                    </outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <configuration>
                            <passphrase>${gpg.passphrase}</passphrase>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                            <quiet>true</quiet>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>trimSnapshots</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>1.7</version>
                        <executions>
                            <execution>
                                <id>remove-old-artifacts</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>remove-project-artifact</goal>
                                </goals>
                                <configuration>
                                    <removeAll>true
                                    </removeAll><!-- remove all versions of built artifacts including all versions.  Install phase will regenerate -->
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>1.9build</id>
            <activation>
                <jdk>1.9</jdk>
            </activation>
            <properties>
                <maven.compiler.release>7</maven.compiler.release>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-toolchains-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>libnd4jhome-defined</id>
            <activation>
                <property>
                    <name>env.LIBND4J_HOME</name>
                </property>
            </activation>
            <properties>
                <libnd4jhome>${env.LIBND4J_HOME}</libnd4jhome>
            </properties>
        </profile>
        <profile>
            <id>libnd4jhome-undefined</id>
            <activation>
                <property>
                    <name>!env.LIBND4J_HOME</name>
                </property>
            </activation>
            <properties>
                <libnd4jhome>${basedir}/../../../../libnd4j/</libnd4jhome>
            </properties>
        </profile>

        <!-- For Android: -Dplatform=android-arm -->
        <profile>
            <id>javacpp-platform-default</id>
            <activation>
                <property>
                  <name>!javacpp.platform</name>
                </property>
            </activation>
            <properties>
                <javacpp.platform>${os.name}-${os.arch}</javacpp.platform>
            </properties>
        </profile>

        <!-- Profiles to set the default javacpp.platform property: If someone knows a better way to do this, please do let me know! -->
        <profile>
            <id>linux</id>
            <activation>
                <os>
                    <name>linux</name>
                </os>
            </activation>
            <properties>
                <os.kernel>linux</os.kernel>
                <os.name>linux</os.name>
            </properties>
        </profile>
        <profile>
            <id>macosx</id>
            <activation>
                <os>
                    <name>mac os x</name>
                </os>
            </activation>
            <properties>
                <os.kernel>darwin</os.kernel>
                <os.name>macosx</os.name>
            </properties>
        </profile>
        <profile>
            <id>windows</id>
            <activation>
                <os>
                    <family>windows</family>
                </os>
            </activation>
            <properties>
                <os.kernel>windows</os.kernel>
                <os.name>windows</os.name>
            </properties>
        </profile>
        <profile>
            <id>arm</id>
            <activation>
                <os>
                    <arch>arm</arch>
                </os>
            </activation>
            <properties>
                <os.arch>armhf</os.arch>
            </properties>
        </profile>
        <profile>
            <id>aarch64</id>
            <activation>
                <os>
                    <arch>aarch64</arch>
                </os>
            </activation>
            <properties>
                <os.arch>arm64</os.arch>
            </properties>
        </profile>
        <profile>
            <id>armv8</id>
            <activation>
                <os>
                    <arch>armv8</arch>
                </os>
            </activation>
            <properties>
                <os.arch>arm64</os.arch>
            </properties>
        </profile>
        <profile>
            <id>i386</id>
            <activation>
                <os>
                    <arch>i386</arch>
                </os>
            </activation>
            <properties>
                <os.arch>x86_64</os.arch>
            </properties>
        </profile>
        <profile>
            <id>i486</id>
            <activation>
                <os>
                    <arch>i486</arch>
                </os>
            </activation>
            <properties>
                <os.arch>x86_64</os.arch>
            </properties>
        </profile>
        <profile>
            <id>i586</id>
            <activation>
                <os>
                    <arch>i586</arch>
                </os>
            </activation>
            <properties>
                <os.arch>x86_64</os.arch>
            </properties>
        </profile>
        <profile>
            <id>i686</id>
            <activation>
                <os>
                    <arch>i686</arch>
                </os>
            </activation>
            <properties>
                <os.arch>x86_64</os.arch>
            </properties>
        </profile>
        <profile>
            <id>x86</id>
            <activation>
                <os>
                    <arch>x86</arch>
                </os>
            </activation>
            <properties>
                <os.arch>x86_64</os.arch>
            </properties>
        </profile>
        <profile>
            <id>amd64</id>
            <activation>
                <os>
                    <arch>amd64</arch>
                </os>
            </activation>
            <properties>
                <os.arch>x86_64</os.arch>
            </properties>
        </profile>
        <profile>
            <id>x86-64</id>
            <activation>
                <os>
                    <arch>x86-64</arch>
                </os>
            </activation>
            <properties>
                <os.arch>x86_64</os.arch>
            </properties>
        </profile>

        <!-- Integration Tests Profile. By default (when this profile is not enabled) unit tests are run only.
             Note also that some tests may run fewer/quicker cases for unit tests vs. integration tests
        -->
        <profile>
            <id>integration-tests</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven-surefire-plugin.version}</version>
                        <inherited>true</inherited>
                        <configuration>
                            <environmentVariables>
                                <DL4J_INTEGRATION_TESTS>true</DL4J_INTEGRATION_TESTS>
                            </environmentVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>