<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.eclairjs</groupId>
  <artifactId>eclairjs-nashorn</artifactId>
  <version>0.7</version>

  <name>EclairJS Nashorn</name>
  <description>JavaScript API for Apache Spark</description>
  <url>https://github.com/EclairJS/eclairjs-nashorn</url>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>EclairJS</name>
      <email>eclairjs@us.ibm.com</email>
      <organization>IBM Corporation</organization>
      <organizationUrl>http://www.ibm.com</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:eclairjs/eclairjs-nashorn.git</connection>
    <developerConnection>scm:git:git@github.com:eclairjs/eclairjs-nashorn.git</developerConnection>
    <url>git@github.com:eclairjs/eclairjs-nashorn.git</url>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>
  
  <repositories>
    <repository>
      <id>apache-snapshots</id>
      <name>Apache Snapshot repository</name>
      <url>
        https://repository.apache.org/content/groups/snapshots
      </url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.19.1</version>
        <configuration>
          <argLine>-Dlog4j.configuration=file:"./src/test/resources/conf/log4j.prop"
          </argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.4.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>jar-with-dependencies</shadedClassifierName> <!-- Any name that makes sense -->
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.2.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-javadoc-plugin</artifactId>
        <version>2.10.4</version>
        <configuration>
          <!--excludePackageNames>org.eclairjs.*:examples:</excludePackageNames-->
          <excludePackageNames>examples:</excludePackageNames>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <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.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.3</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>
                      com.phasebash.jsdoc
                    </groupId>
                    <artifactId>
                      jsdoc3-maven-plugin
                    </artifactId>
                    <versionRange>
                      [1.1.0,)
                    </versionRange>
                    <goals>
                      <goal>jsdoc3</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <properties>
    <spark.version>1.6.0</spark.version>
    <hadoop.version>2.6.0</hadoop.version>
    <toree.version>0.1.0.dev6-incubating-SNAPSHOT</toree.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>2.10.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-core_2.10</artifactId>
      <version>${spark.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-sql_2.10</artifactId>
      <version>${spark.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-catalyst_2.10</artifactId>
      <version>${spark.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-hive_2.10</artifactId>
      <version>${spark.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-streaming_2.10</artifactId>
      <version>${spark.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-mllib_2.10</artifactId>
      <version>${spark.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-streaming-kafka_2.10</artifactId>
      <version>${spark.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-streaming-twitter_2.10</artifactId>
      <version>${spark.version}</version>
    </dependency>
    <dependency>
      <!-- needed to support OpenStack Object Store swift:// -->
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-openstack</artifactId>
      <version>${hadoop.version}</version>
    </dependency>
    <dependency>
      <groupId>com.googlecode.json-simple</groupId>
      <artifactId>json-simple</artifactId>
      <version>1.1</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.4</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <profiles>
    <profile>
      <id>local</id>
      <properties>
        <spark.scope>compile</spark.scope>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.scala-lang</groupId>
          <artifactId>scala-library</artifactId>
          <version>2.10.2</version>
        </dependency>
        <dependency>
          <groupId>org.apache.spark</groupId>
          <artifactId>spark-core_2.10</artifactId>
          <version>${spark.version}</version>
        </dependency>
        <dependency>
          <groupId>org.apache.spark</groupId>
          <artifactId>spark-sql_2.10</artifactId>
          <version>${spark.version}</version>
        </dependency>
        <dependency>
          <groupId>org.apache.spark</groupId>
          <artifactId>spark-catalyst_2.10</artifactId>
          <version>${spark.version}</version>
        </dependency>
        <dependency>
          <groupId>org.apache.spark</groupId>
          <artifactId>spark-hive_2.10</artifactId>
          <version>${spark.version}</version>
        </dependency>
        <dependency>
          <groupId>org.apache.spark</groupId>
          <artifactId>spark-streaming_2.10</artifactId>
          <version>${spark.version}</version>
        </dependency>
        <dependency>
          <groupId>org.apache.spark</groupId>
          <artifactId>spark-mllib_2.10</artifactId>
          <version>${spark.version}</version>
        </dependency>
      </dependencies>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>env</name>
          <value>local</value>
        </property>
      </activation>
    </profile>
    <profile>
      <id>notebook</id>
      <dependencies>
        <dependency>
          <groupId>org.apache.toree</groupId>
          <artifactId>toree-kernel-api_2.10</artifactId>
          <version>${toree.version}</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.toree</groupId>
          <artifactId>toree-kernel_2.10</artifactId>
          <version>${toree.version}</version>
          <scope>provided</scope>
        </dependency>
        <!--dependency>
          <groupId>org.apache.toree</groupId>
          <artifactId>toree</artifactId>
          <version>${toree.version}</version>
          <scope>system</scope>
          <systemPath>/Users/bburns/dev/incubator-toree/dist/toree/lib/toree-assembly-0.1.0.dev6-incubating-SNAPSHOT.jar</systemPath>
        </dependency-->

      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>scala-compile-first</id>
                <phase>initialize</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>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>docs</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.phasebash.jsdoc</groupId>
            <artifactId>jsdoc3-maven-plugin</artifactId>
            <version>1.2.0</version>
            <executions>
              <execution>
                <phase>compile</phase>
                <goals>
                  <goal>jsdoc3</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <recursive>true</recursive>
              <directoryRoots>
                <directoryRoot>src/main/resources</directoryRoot>
              </directoryRoots>
              <outputDirectory>docs/jsdoc</outputDirectory>
            </configuration>
          </plugin>

        </plugins>
      </build>
    </profile>
  </profiles>
</project>
