<?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">
    <parent>
        <artifactId>deeplearning4j-ui-parent</artifactId>
        <groupId>org.deeplearning4j</groupId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>deeplearning4j-play_2.11</artifactId>
    <name>deeplearning4j-play</name>

    <properties>
        <!-- Default scala versions, may be overwritten by build profiles -->
        <scala.version>2.11.12</scala.version>
        <scala.binary.version>2.11</scala.binary.version>
    </properties>

    <profiles>
        <!-- To build UI templates: run "mvn compile -P buildUiTemplates" -->
        <profile>
            <id>buildUiTemplates</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.google.code.play2-maven-plugin</groupId>
                        <artifactId>play2-maven-plugin</artifactId>
                        <version>${maven-play2-plugin.version}</version>

                        <!-- Generate Scala Page Templates
                        The Play framework template engine ("twirl") uses templates for HTML pages (or in principle any text-based
                        data: CSV, XML etc). These templates (*.scala.html files) need to be converted to Scala classes using
                        code generation. This is done here during the Maven compile phase.
                        However, the Maven Play framework plugin does not allow proper customization of the output directory. Thus,
                        we generate these Scala classes in the default location (in the target/twirl/main/ directory) and use the
                        maven resources plugin to copy them to the actual location we want.
                        To generate the latest versions of these templates (after modifying or adding a new template), just run
                        "mvn compile" in either the main project directory, or within the deeplearning4j ui module separately.
                        -->
                        <executions>
                            <execution>
                                <id>GenerateTemplates</id>
                                <phase>compile</phase>
                                <configuration>
                                </configuration>
                                <goals>
                                    <goal>template-compile</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Copy the generated Scala templates to the appropriate directory. See templates comment above. -->
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <version>${maven-resources-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>CopyTemplates</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${basedir}/src/main/scala/org/deeplearning4j/ui/views/html</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>${basedir}/target/twirl/main/org/deeplearning4j/ui/views/html</directory>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>test-nd4j-native</id>
            <dependencies>
                <dependency>
                    <groupId>org.nd4j</groupId>
                    <artifactId>nd4j-native</artifactId>
                    <version>${project.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>test-nd4j-cuda-10.1</id>
            <dependencies>
                <dependency>
                    <groupId>org.nd4j</groupId>
                    <artifactId>nd4j-cuda-10.1</artifactId>
                    <version>${project.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>org.deeplearning4j</groupId>
            <artifactId>deeplearning4j-ui-model</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>${google.protobuf.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>${ws.rs.version}</version>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${jodatime.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>${hibernate.version}</version>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-reflect</artifactId>
            <version>${scala.version}</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>${snakeyaml.version}</version>
        </dependency>
        <dependency>
            <groupId>com.typesafe.play</groupId>
            <artifactId>play-java_2.11</artifactId>
            <version>${playframework.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.google.code.findbugs</groupId>
                    <artifactId>jsr305</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>jul-to-slf4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>jcl-over-slf4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>net.jodah</groupId>
                    <artifactId>typetools</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>net.jodah</groupId>
            <artifactId>typetools</artifactId>
            <version>${jodah.typetools.version}</version>
        </dependency>

        <dependency>
            <groupId>com.typesafe.play</groupId>
            <artifactId>play-netty-server_2.11</artifactId>
            <version>${playframework.version}</version>
        </dependency>

        <dependency>
            <groupId>org.fusesource.leveldbjni</groupId>
            <artifactId>leveldbjni-all</artifactId>
            <version>${leveldb.version}</version>
        </dependency>

        <dependency>
            <groupId>com.beust</groupId>
            <artifactId>jcommander</artifactId>
            <version>${jcommander.version}</version>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>    <!-- Version set by deeplearning4j-parent dependency management -->
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>    <!-- Version set by deeplearning4j-parent dependency management -->
            <scope>compile</scope>
            <version>1.7.21</version>
        </dependency>

        <!-- Test Scope Dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>              <!-- Version set by deeplearning4j-parent dependency management -->
            <scope>test</scope>
        </dependency>

        <!-- WebJars Dependencies -->
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>babel__polyfill</artifactId>
            <version>7.4.4</version>
        </dependency>

        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>coreui__coreui</artifactId>
            <version>2.1.9</version>
            <exclusions>
                <exclusion>
                    <groupId>org.webjars.npm</groupId>
                    <artifactId>coreui__coreui-plugin-npm-postinstall</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>coreui__icons</artifactId>
            <version>0.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>jquery</artifactId>
            <version>3.4.1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.bower</groupId>
            <artifactId>popper.js</artifactId>
            <version>1.12.9</version>
        </dependency>

        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>bootstrap</artifactId>
            <version>4.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery</artifactId>
            <version>2.2.0</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery-migrate</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery-ui</artifactId>
            <version>1.10.2</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>modernizr</artifactId>
            <!--<version>2.6.2</version>-->
            <version>2.8.3-1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery-cookie</artifactId>
            <version>1.4.1-1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>fullcalendar</artifactId>
            <version>1.6.4</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>excanvas</artifactId>
            <version>3</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>cytoscape</artifactId>
            <version>3.3.3</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.bower</groupId>
            <artifactId>cytoscape-dagre</artifactId>
            <version>2.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>dagre</artifactId>
            <version>0.8.4</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>cytoscape-cola</artifactId>
            <version>2.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>webcola</artifactId>
            <version>3.1.3</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>cytoscape-cose-bilkent</artifactId>
            <version>4.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>cytoscape-euler</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>cytoscape-klay</artifactId>
            <version>3.1.2</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>klayjs</artifactId>
            <version>0.4.1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>cytoscape-spread</artifactId>
            <version>3.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>weaverjs</artifactId>
            <version>1.2.0</version>
        </dependency>

        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>retinajs</artifactId>
            <version>0.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>flot</artifactId>
            <version>0.8.3</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>chosen</artifactId>
            <version>0.9.8</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>uniform</artifactId>
            <version>2.1.2-1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>noty</artifactId>
            <version>2.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery-raty</artifactId>
            <version>2.5.2</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>imagesloaded</artifactId>
            <version>2.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>masonry</artifactId>
            <version>3.1.5</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery.sparkline</artifactId>
            <version>2.1.2</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery-knob</artifactId>
            <version>1.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>datatables</artifactId>
            <version>1.9.4</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery-ui-touch-punch</artifactId>
            <version>0.2.2</version>
        </dependency>

        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>d3js</artifactId>
            <version>3.3.5</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>bootstrap-notify</artifactId>
            <version>3.1.3-1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>github-com-jboesch-Gritter</artifactId>
            <version>1.7.4</version>
        </dependency>

        <!-- Fonts -->
        <dependency>
            <groupId>org.webjars.bowergithub.stenin-nikita</groupId>
            <artifactId>open-sans</artifactId>
            <version>0.1.3</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>font-awesome</artifactId>
            <version>3.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>bootstrap-glyphicons</artifactId>
            <version>bdd2cbfba0</version>
        </dependency>

        <!-- For SameDiff UI -->
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>flatbuffers</artifactId>
            <version>1.9.0</version>
        </dependency>

        <!-- Workaround for Java 9+ -->
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>${jaxb.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>


    <build>
        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <configuration>
                    <scalaVersion>${scala.version}</scalaVersion>
                </configuration>
            </plugin>

            <!-- Build helper plugin: used to add the multiple independent source directories (Java, Scala, HTML templates) -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/scala</source>
                                <source>src/main/java</source>
                                <source>src/main/views</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.google.code.sbt-compiler-maven-plugin</groupId>
                <artifactId>sbt-compiler-maven-plugin</artifactId>
                <version>${sbt-compiler-maven-plugin.version}</version>
            </plugin>

            <!-- Maven compiler plugin last: should ensure Scala code is compiled before Java code -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>  <!-- Version set by deeplearning4j-parent dependency management -->
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>


    <dependencyManagement>
        <dependencies>
            <!-- Override webjars dependencies with fixed versions.
            See issue #7730 for details
            WebJars defines its dependencies using ranges - [3.10.0,4)
            However, we want to lock down the versions, for a few reasons:
            (a) When defined in a range like this, user builds will check on every build of their project
            (b) It makes it harder to debug issues, if user and developers are using different versions
            (c) Though in-principle this should be safe, we can't be sure that a 3rd party change won't break our UI with a new version
            (d) The ranges don't always work as expected in practice: in one instance 3.0.0-beta9 was considered within the range [2.0.0,3)
             -->

            <!-- babel__polyfill dependencies -->
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>core-js</artifactId>
                <version>2.6.5</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>regenerator-runtime</artifactId>
                <version>0.13.2</version>
            </dependency>

            <!-- coreui__coreui dependencies -->
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>bootstrap</artifactId>
                <version>4.3.1</version>
            </dependency>

            <!-- org.webjars.npm:cytoscape -->
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>heap</artifactId>
                <version>0.2.6</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>lodash.debounce</artifactId>
                <version>4.0.8</version>
            </dependency>


            <!-- org.webjars.npm:dagre -->
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>graphlib</artifactId>
                <version>2.1.7</version>
            </dependency>



            <dependency>
                <groupId>org.webjars.bower</groupId>
                <artifactId>cytoscape</artifactId>
                <version>3.2.5</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.bower</groupId>
                <artifactId>dagre</artifactId>
                <version>0.7.4</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.bower</groupId>
                <artifactId>graphlib</artifactId>
                <version>1.0.7</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.bower</groupId>
                <artifactId>lodash</artifactId>
                <version>3.10.1</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>lodash</artifactId>
                <version>4.17.11</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>webcola</artifactId>
                <version>3.3.8</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>d3-dispatch</artifactId>
                <version>1.0.5</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>d3-drag</artifactId>
                <version>1.2.3</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>d3-selection</artifactId>
                <version>1.4.0</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>d3-timer</artifactId>
                <version>1.0.9</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>klayjs</artifactId>
                <version>0.4.1</version>
            </dependency>
            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>weaverjs</artifactId>
                <version>1.2.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>