<?xml version="1.0" encoding="UTF-8"?>
<!--
  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. See accompanying LICENSE file.
-->

<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>com.streamsets</groupId>
  <artifactId>streamsets-datacollector-plugin-api</artifactId>
  <version>3.18.1</version>
  <description>StreamSets Data Collector Plugin API</description>
  <modules>
    <module>streamsets-datacollector-spark-api</module>
  </modules>
  <name>StreamSets Data Collector Plugin API</name>
  <packaging>pom</packaging>
  <url>http://www.streamsets.com</url>
  <scm>
    <url>https://github.com/streamsets/datacollector-plugin-api</url>
  </scm>

  <developers>
    <!-- TODO add rest of team-->
    <developer>
      <id>hshreedharan</id>
      <name>Hari Shreedharan</name>
      <email>hshreedharan@streamsets.com</email>
      <timezone>America/Los_Angeles</timezone>
    </developer>
  </developers>

  <organization>
    <name>StreamSets</name>
    <url>http://www.streamsets.com</url>
  </organization>

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

  <properties>
    <!-- required JDK version -->
    <javaVersion>1.8</javaVersion>

    <!-- Testcases output redirection -->
    <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>

    <!-- Platform encoding override -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- Dependency Versions

         All dependency versions should be defined here to avoid version
         mismatches with multiple artifacts of the same logical dependency.

         These are the same as the api pom - keep these in sync.
    -->
    <guava.version>18.0</guava.version>
    <spark.version>2.1.1</spark.version>
    <junit.version>4.11</junit.version>
    <log4j.version>1.2.17</log4j.version>
    <metrics.version>3.1.0</metrics.version>
    <mockito.version>1.10.7</mockito.version>
    <slf4j.version>1.7.7</slf4j.version>
  </properties>

  <profiles>
    <profile>
      <id>sign</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>javadoc-java8</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <jdk>1.8</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <!-- Thank you Java 8 -->
              <additionalparam>-Xdoclint:none</additionalparam>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.3.1</version>
        <configuration>
          <rules>
            <requireMavenVersion>
              <version>[3.2.1,)</version>
            </requireMavenVersion>
            <requireJavaVersion>
              <version>${javaVersion}</version>
            </requireJavaVersion>
          </rules>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>${javaVersion}</source>
          <target>${javaVersion}</target>
        </configuration>
        <executions>
          <execution>
            <id>default-compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <!--
                Disable annotation processing during main compile time only. We need it for testcases.
              -->
              <compilerArgument>-proc:none</compilerArgument>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.18.1</version>
      </plugin>

      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.8</version>
        <configuration>
          <excludes>

            <exclude>CHANGES.txt</exclude>

            <exclude>.idea/**</exclude>
            <exclude>**/*.iml</exclude>

            <exclude>.git/**</exclude>
            <exclude>.gitignore</exclude>
            <exclude>.gitreview</exclude>

	    <!-- Jenkins -->
            <exclude>**/buildInfo*.properties</exclude>
            <exclude>**/ok</exclude>
            <exclude>**/classworlds*conf</exclude>

            <exclude>**/target/**</exclude>

            <exclude>**/*.json</exclude>

            <exclude>src/main/resources/META-INF/services/**</exclude>

          </excludes>
        </configuration>
        <executions>
          <execution>
            <id>rat-check</id>
            <phase>package</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.8.2</version>
      </plugin>

    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.8</version>
        <configuration>
          <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
          <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
        </configuration>
        <reportSets>
          <reportSet>
            <reports>
              <report>dependencies</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

</project>
