<?xml version="1.0"?>
<!--
/**
 * Copyright (c) 2015 MapR, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://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.
 */
-->
<project
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
  xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.ojai</groupId>
  <artifactId>ojai-root</artifactId>

  <name>OJAI Root Pom</name>
  <packaging>pom</packaging>
  <description>Open JSON Application Interface</description>
  <url>https://github.com/ojai</url>

  <organization>
    <name>MapR Technologies, Inc.</name>
    <url>http://www.mapr.com</url>
  </organization>

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

  <scm>
    <connection>scm:git:git@github.com:ojai/ojai.git</connection>
    <url>https://github.com/ojai/ojai</url>
  </scm>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/ojai/ojai/issues</url>
  </issueManagement>
  <developers>
    <developer>
      <id>adityakishore</id>
      <name>Aditya Kishore</name>
      <email>adityakishore@gmail.com</email>
      <roles>
        <role>developer</role>
      </roles>
      <timezone>-8</timezone>
    </developer>
  </developers>
  <inceptionYear>2015</inceptionYear>

  <distributionManagement>
    <repository>
      <id>${distMgmtStagingId}</id>
      <name>${distMgmtStagingName}</name>
      <url>${distMgmtStagingUrl}</url>
    </repository>
    <snapshotRepository>
      <id>${distMgmtSnapshotsId}</id>
      <name>${distMgmtSnapshotsName}</name>
      <url>${distMgmtSnapshotsUrl}</url>
    </snapshotRepository>
  </distributionManagement>

  <!-- When the version is updated, ensure that the property 'ojai.version' is also updated with the same literal string -->
  <version>3.0</version>
  <properties>
    <ojai.version>3.0</ojai.version>

    <distMgmtSnapshotsId>ossrh</distMgmtSnapshotsId>
    <distMgmtSnapshotsName>Sonatype Snapshot Repository</distMgmtSnapshotsName>
    <distMgmtSnapshotsUrl>https://oss.sonatype.org/content/repositories/snapshots</distMgmtSnapshotsUrl>
    <distMgmtStagingId>ossrh</distMgmtStagingId>
    <distMgmtStagingName>Sonatype Release Distribution Repository</distMgmtStagingName>
    <distMgmtStagingUrl>https://oss.sonatype.org/service/local/staging/deploy/maven2</distMgmtStagingUrl>

    <guava.version>18.0</guava.version>
    <slf4j.version>1.7.12</slf4j.version>
    <hadoop.version>2.7.1</hadoop.version>
    <jackson.version>2.9.5</jackson.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <gpg.useagent>true</gpg.useagent>
    <gpg.keyname>adityakishore@gmail.com</gpg.keyname>
  </properties>

  <modules>
    <module>java/core</module>
    <module>java/map-reduce</module>
    <module>scala</module>
  </modules>

  <build>
    <pluginManagement>
      <plugins>
        <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>
            <useIncrementalCompilation>false</useIncrementalCompilation>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.antlr</groupId>
          <artifactId>antlr4-maven-plugin</artifactId>
          <version>4.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.18.1</version>
          <configuration>
            <!-- Force the time zone to the PDT timezone to ensure proper parsing of date/time strings -->
            <argLine>-Duser.timezone=GMT-07</argLine>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.6</version>
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <git-commit-id>${git.commit.id}</git-commit-id>
                <git-tags>${git.tags}</git-tags>
                <git-commit-message>${git.commit.message.short}</git-commit-message>
                <git-commit-user-name>${git.commit.user.name}</git-commit-user-name>
                <git-commit-time>${git.commit.time}</git-commit-time>
                <git-branch>${git.branch}</git-branch>
                <git-dirty>${git.dirty}</git-dirty>
              </manifestEntries>
            </archive>
          </configuration>
          <executions>
            <execution>
              <goals><goal>test-jar</goal></goals>
              <configuration>
                <skipIfEmpty>true</skipIfEmpty>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.3</version>
        </plugin>
        <plugin>
          <groupId>net.alchim31.maven</groupId>
          <artifactId>scala-maven-plugin</artifactId>
          <version>3.2.2</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <!-- Generate build.info -->
      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
        <version>2.2.0</version>
        <executions>
          <execution>
            <inherited>true</inherited>
            <goals>
              <goal>revision</goal>
            </goals>
            <configuration>
              <generateGitPropertiesFilename>target/classes/git.properties</generateGitPropertiesFilename>
            </configuration>
          </execution>
        </executions>

        <configuration>
          <dateFormat>${maven.build.timestamp.format}</dateFormat>
          <verbose>false</verbose>
          <skipPoms>true</skipPoms>
          <generateGitPropertiesFile>false</generateGitPropertiesFile>
          <failOnNoGitDirectory>false</failOnNoGitDirectory>
          <gitDescribe>
            <skip>false</skip>
            <always>false</always>
            <abbrev>7</abbrev>
            <forceLongFormat>true</forceLongFormat>
          </gitDescribe>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-runtime</artifactId>
        <version>4.5</version>
        <exclusions>
          <exclusion>
            <artifactId>org.abego.treelayout.core</artifactId>
            <groupId>org.abego.treelayout</groupId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${guava.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      <dependency>
        <groupId>org.ojai</groupId>
        <artifactId>ojai</artifactId>
        <version>${ojai.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-mapreduce-client-core</artifactId>
        <version>${hadoop.version}</version>
        <optional>true</optional>
        <exclusions>
          <exclusion>
            <!-- requires maven 3.2.1 -->
            <groupId>*</groupId>
            <artifactId>*</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <!-- Used for FileSystem and Path classes -->
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-common</artifactId>
        <version>${hadoop.version}</version>
        <optional>true</optional>
        <exclusions>
          <exclusion>
            <!-- requires maven 3.2.1 -->
            <groupId>*</groupId>
            <artifactId>*</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.module</groupId>
        <artifactId>jackson-module-scala_2.11</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      <!-- Test dependencies -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.1.3</version>
        <scope>provided</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!-- Test dependencies -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                  <goal>test-jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <archive>
                <manifest>
                  <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                </manifest>
                <manifestEntries>
                  <git-commit-id>${git.commit.id}</git-commit-id>
                  <git-tags>${git.tags}</git-tags>
                  <git-commit-message>${git.commit.message.short}</git-commit-message>
                  <git-commit-user-name>${git.commit.user.name}</git-commit-user-name>
                  <git-commit-time>${git.commit.time}</git-commit-time>
                  <git-branch>${git.branch}</git-branch>
                  <git-dirty>${git.dirty}</git-dirty>
                </manifestEntries>
              </archive>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>generate-javadoc</id>
                <phase>verify</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <failOnError>false</failOnError>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <archive>
                <manifest>
                  <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                </manifest>
                <manifestEntries>
                  <git-commit-id>${git.commit.id}</git-commit-id>
                  <git-tags>${git.tags}</git-tags>
                  <git-commit-message>${git.commit.message.short}</git-commit-message>
                  <git-commit-user-name>${git.commit.user.name}</git-commit-user-name>
                  <git-commit-time>${git.commit.time}</git-commit-time>
                  <git-branch>${git.branch}</git-branch>
                  <git-dirty>${git.dirty}</git-dirty>
                </manifestEntries>
              </archive>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <keyname>${gpg.keyname}</keyname>
              <useAgent>${gpg.useagent}</useAgent>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
