<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <!--parent>
        <groupId>ai.h2o</groupId>
        <artifactId>xgboost-jvm_2.12</artifactId>
        <version>1.6.1</version>
    </parent-->
    <groupId>ai.h2o</groupId>
    <artifactId>xgboost4j_2.12</artifactId>
    <version>1.6.1.24</version>
    <packaging>jar</packaging>
    <name>xgboost4j</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.version>3.3.9</maven.version>
        <scala.version>2.12.8</scala.version>
        <scala.binary.version>2.12</scala.binary.version>
        <hadoop.version>2.7.3</hadoop.version>
        <skip.create_jni>false</skip.create_jni>
        <log.capi.invocation>OFF</log.capi.invocation>
        <use.cuda>OFF</use.cuda>
    </properties>

    <description>H2O XGBoost Libraries</description>
    <url>https://github.com/h2oai/xgboost</url>
    <inceptionYear>2013</inceptionYear>
    <organization>
        <name>H2O.ai</name>
        <url>http://h2o.ai/</url>
    </organization>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/h2oai/xgboost</url>
        <connection>scm:git:https://github.com/h2oai/xgboost.git</connection>
        <developerConnection>scm:git:git@github.com:h2oai/xgboost.git</developerConnection>
    </scm>

    <developers>
        <developer>
            <id>oss</id>
            <name>Open Source Google Group</name>
            <email>https://groups.google.com/forum/#!forum/h2ostream</email>
        </developer>
    </developers>

    <issueManagement>
        <system>Jira</system>
        <url>http://jira.h2o.ai</url>
    </issueManagement>
    <profiles>
        <profile>
            <id>local-nexus-snapshot</id>
            <activation>
                <property>
                    <name>target.nexus</name>
                    <value>snapshot</value>
                </property>
            </activation>
            <properties/>
            <distributionManagement>
                <repository>
                    <id>LocalNexus</id>
                    <name>Local Nexus</name>
                    <url>http://nexus:8081/nexus/repository/snapshots</url>
                </repository>
            </distributionManagement>
        </profile>
        <profile>
            <id>local-nexus</id>
            <activation>
                <property>
                    <name>target.nexus</name>
                    <value>local</value>
                </property>
            </activation>
            <properties/>
            <distributionManagement>
                <repository>
                    <id>LocalNexus</id>
                    <name>Local Nexus</name>
                    <url>http://nexus:8081/nexus/repository/releases</url>
                </repository>
            </distributionManagement>
        </profile>
        <profile>
            <id>public-nexus</id>
            <activation>
                <property>
                    <name>target.nexus</name>
                    <value>public</value>
                </property>
            </activation>
            <properties/>
            <distributionManagement>
                <repository>
                    <id>PublicNexus</id>
                    <name>Central Maven</name>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
        <profile>
            <id>spark-2.x</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
        <profile>
            <id>no-lib</id>
            <activation>
                <property>
                    <name>exclude.xgboost.lib</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <excludeLibs>lib/*</excludeLibs>
                <skip.create_jni>true</skip.create_jni>
            </properties>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-hdfs</artifactId>
            <version>${hadoop.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-common</artifactId>
            <version>${hadoop.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.typesafe.akka</groupId>
            <artifactId>akka-actor_${scala.binary.version}</artifactId>
            <version>2.5.23</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.typesafe.akka</groupId>
            <artifactId>akka-testkit_${scala.binary.version}</artifactId>
            <version>2.5.23</version>
            <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.scalatest</groupId>
          <artifactId>scalatest_${scala.binary.version}</artifactId>
          <version>3.0.5</version>
          <scope>provided</scope>
        </dependency>
      <dependency>
        <groupId>com.esotericsoftware.kryo</groupId>
        <artifactId>kryo</artifactId>
        <version>2.21</version>
      </dependency>
    </dependencies>

    <build>
      <resources>
          <resource>
              <directory>src/main/resources</directory>
              <excludes>
                  <exclude>${excludeLibs}</exclude>
              </excludes>
          </resource>
      </resources>
      <plugins>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-gpg-plugin</artifactId>
              <version>1.5</version>
              <executions>
                  <execution>
                      <id>sign-artifacts</id>
                      <phase>verify</phase>
                      <goals>
                          <goal>sign</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>2.10.3</version>
              <configuration>
                <excludePackageNames>
                  ai.h2o.xgboost4j.java.example
                </excludePackageNames>
                  <show>protected</show>
                  <nohelp>true</nohelp>
              </configuration>
              <executions>
                  <execution>
                      <id>attach-javadocs</id>
                      <goals>
                          <goal>jar</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-source-plugin</artifactId>
              <version>3.0.1</version>
              <executions>
                  <execution>
                      <id>attach-sources</id>
                      <goals>
                          <goal>jar-no-fork</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-assembly-plugin</artifactId>
              <configuration>
                  <skipAssembly>false</skipAssembly>
              </configuration>
          </plugin>
          <plugin>
              <artifactId>exec-maven-plugin</artifactId>
              <groupId>org.codehaus.mojo</groupId>
              <version>1.6.0</version>
              <executions>
                  <execution>
                      <id>native</id>
                      <phase>generate-sources</phase>
                      <goals>
                          <goal>exec</goal>
                      </goals>
                      <configuration>
                          <skip>${skip.create_jni}</skip>
                          <executable>python3</executable>
                          <arguments>
                            <argument>create_jni.py</argument>
                            <argument>--log-capi-invocation</argument>
                            <argument>${log.capi.invocation}</argument>
                          </arguments>
                          <workingDirectory>${user.dir}/..</workingDirectory>
                      </configuration>
                  </execution>
                  <!--
                  <execution>
                      <id>extractLibs</id>
                      <phase>package</phase>
                      <goals>
                          <goal>exec</goal>
                      </goals>
                      <configuration>
                          <executable>./extract_jars.sh</executable>
                          <arguments>
                              <argument>xgboost4j/target/${project.build.finalName}.${project.packaging}</argument>
                              <argument>${extractLibs.suffix}</argument>
                          </arguments>
                          <workingDirectory>${user.dir}</workingDirectory>
                      </configuration>
                  </execution>-->
              </executions>
          </plugin>
          <plugin>
              <groupId>net.alchim31.maven</groupId>
              <artifactId>scala-maven-plugin</artifactId>
              <version>3.2.2</version>
              <executions>
                  <execution>
                      <id>compile</id>
                      <goals>
                          <goal>compile</goal>
                      </goals>
                      <phase>compile</phase>
                  </execution>
                  <execution>
                      <id>test-compile</id>
                      <goals>
                          <goal>testCompile</goal>
                      </goals>
                      <phase>test-compile</phase>
                  </execution>
                  <execution>
                      <phase>process-resources</phase>
                      <goals>
                          <goal>compile</goal>
                      </goals>
                  </execution>
                  <execution>
                      <id>scala-compile-first</id>
                      <phase>process-resources</phase>
                      <goals>
                          <goal>compile</goal>
                          <goal>add-source</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-jar-plugin</artifactId>
              <version>3.0.2</version>
              <executions>
                  <execution>
                      <goals>
                          <goal>test-jar</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-resources-plugin</artifactId>
              <version>3.1.0</version>
              <configuration>
                  <nonFilteredFileExtensions>
                      <nonFilteredFileExtension>dll</nonFilteredFileExtension>
                      <nonFilteredFileExtension>dylib</nonFilteredFileExtension>
                      <nonFilteredFileExtension>so</nonFilteredFileExtension>
                  </nonFilteredFileExtensions>
              </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>3.2.4</version>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>shade</goal>
                </goals>
                <configuration>
                  <artifactSet>
                    <includes>
                      <include>ai.h2o:*</include>
                    </includes>
                  </artifactSet>
                  <relocations>
                    <relocation>
                      <pattern>ml.dmlc.xgboost4j.java</pattern>
                      <shadedPattern>ai.h2o.xgboost4j.java</shadedPattern>
                    </relocation>
                  </relocations>
                </configuration>
              </execution>
            </executions>
          </plugin>
      </plugins>
    </build>
</project>
