<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright © 2020 Cask Data, 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 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>io.cdap.plugin</groupId>
  <artifactId>zendesk-plugins</artifactId>
  <version>1.0.0</version>
  <packaging>jar</packaging>
  <name>Zendesk plugins</name>
  <description>Zendesk Plugins</description>
  <url>https://github.com/data-integrations/zendesk</url>

  <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>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>CDAP</name>
      <email>cdap-dev@googlegroups.com</email>
      <organization>CDAP</organization>
      <organizationUrl>http://cdap.io</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/data-integrations/zendesk.git</connection>
    <developerConnection>scm:git:git@github.com:data-integrations/zendesk.git</developerConnection>
    <url>https://github.com/data-integrations/zendesk.git</url>
    <tag>HEAD</tag>
  </scm>

  <properties>
    <surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- version properties -->
    <cdap.version>6.1.2</cdap.version>
    <hydrator.version>2.3.5</hydrator.version>
    <hadoop.version>2.8.0</hadoop.version>
    <httpcomponents.version>4.5.9</httpcomponents.version>
    <guava.retrying.version>2.0.0</guava.retrying.version>
    <commons-codec.version>1.4</commons-codec.version>
    <commons-validator.version>1.4.1</commons-validator.version>
    <junit.version>4.11</junit.version>
    <mockito.version>1.10.19</mockito.version>
    <guice.version>4.0</guice.version>
    <zendesk-java-client.version>0.9.0</zendesk-java-client.version>
  </properties>

  <repositories>
    <repository>
      <id>sonatype</id>
      <url>https://oss.sonatype.org/content/groups/public</url>
    </repository>
    <repository>
      <id>sonatype-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
  </repositories>

  <distributionManagement>
      <repository>
          <id>sonatype.release</id>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
      </repository>
      <snapshotRepository>
          <id>sonatype.snapshots</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      </snapshotRepository>
  </distributionManagement>

  <dependencies>
    <dependency>
      <groupId>io.cdap.cdap</groupId>
      <artifactId>cdap-api</artifactId>
      <version>${cdap.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.cdap.cdap</groupId>
      <artifactId>cdap-etl-api</artifactId>
      <version>${cdap.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.cdap.cdap</groupId>
      <artifactId>cdap-formats</artifactId>
      <version>${cdap.version}</version>
    </dependency>
    <dependency>
      <groupId>io.cdap.cdap</groupId>
      <artifactId>cdap-etl-api-spark</artifactId>
      <version>${cdap.version}</version>
    </dependency>
    <dependency>
      <groupId>io.cdap.plugin</groupId>
      <artifactId>hydrator-common</artifactId>
      <version>${hydrator.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
      <version>${hadoop.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
        <exclusion>
          <groupId>log4j</groupId>
          <artifactId>log4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-log4j12</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.avro</groupId>
          <artifactId>avro</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.zookeeper</groupId>
          <artifactId>zookeeper</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.google.guava</groupId>
          <artifactId>guava</artifactId>
        </exclusion>
        <exclusion>
          <artifactId>jersey-core</artifactId>
          <groupId>com.sun.jersey</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jersey-json</artifactId>
          <groupId>com.sun.jersey</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jersey-server</artifactId>
          <groupId>com.sun.jersey</groupId>
        </exclusion>
        <exclusion>
          <artifactId>servlet-api</artifactId>
          <groupId>javax.servlet</groupId>
        </exclusion>
        <exclusion>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>jetty</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>jetty-util</artifactId>
        </exclusion>
        <exclusion>
          <artifactId>jasper-compiler</artifactId>
          <groupId>tomcat</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jasper-runtime</artifactId>
          <groupId>tomcat</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jsp-api</artifactId>
          <groupId>javax.servlet.jsp</groupId>
        </exclusion>
        <exclusion>
          <artifactId>slf4j-api</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-mapreduce-client-core</artifactId>
      <version>${hadoop.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-log4j12</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.google.inject.extensions</groupId>
          <artifactId>guice-servlet</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.sun.jersey</groupId>
          <artifactId>jersey-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.sun.jersey</groupId>
          <artifactId>jersey-server</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.sun.jersey</groupId>
          <artifactId>jersey-json</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.sun.jersey.contribs</groupId>
          <artifactId>jersey-guice</artifactId>
        </exclusion>
        <exclusion>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.google.guava</groupId>
          <artifactId>guava</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>${httpcomponents.version}</version>
    </dependency>
    <dependency>
      <groupId>com.github.rholder</groupId>
      <artifactId>guava-retrying</artifactId>
      <version>${guava.retrying.version}</version>
    </dependency>
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>${commons-codec.version}</version>
    </dependency>
    <dependency>
      <groupId>commons-validator</groupId>
      <artifactId>commons-validator</artifactId>
      <version>${commons-validator.version}</version>
    </dependency>


    <dependency>
      <groupId>io.cdap.cdap</groupId>
      <artifactId>cdap-data-pipeline</artifactId>
      <version>${cdap.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.cdap.cdap</groupId>
      <artifactId>hydrator-test</artifactId>
      <version>${cdap.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
      <version>${guice.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.cloudbees.thirdparty</groupId>
      <artifactId>zendesk-java-client</artifactId>
      <version>${zendesk-java-client.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>io.cdap</groupId>
          <artifactId>cdap-maven-plugin</artifactId>
          <version>1.1.0</version>
          <configuration>
            <cdapArtifacts>
              <parent>system:cdap-data-pipeline[6.1.2,7.0.0-SNAPSHOT)</parent>
            </cdapArtifacts>
          </configuration>
          <executions>
            <execution>
              <id>create-artifact-config</id>
              <phase>prepare-package</phase>
              <goals>
                <goal>create-plugin-json</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.7.0</version>
          <configuration>
            <source>1.8</source>
            <target>1.8</target>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.14.1</version>
          <configuration>
            <argLine>-Xmx5000m -Djava.awt.headless=true -XX:+UseG1GC -XX:OnOutOfMemoryError="kill -9 %p"
              -Djava.net.preferIPv4Stack=true</argLine>
            <reuseForks>false</reuseForks>
            <redirectTestOutputToFile>${surefire.redirectTestOutputToFile}</redirectTestOutputToFile>
            <reportFormat>plain</reportFormat>
            <systemPropertyVariables>
              <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
            </systemPropertyVariables>
            <includes>
              <include>**/*TestsSuite.java</include>
              <include>**/*TestSuite.java</include>
              <include>**/Test*.java</include>
              <include>**/*Test.java</include>
              <include>**/*TestCase.java</include>
            </includes>
            <excludes>
              <exclude>**/*TestRun.java</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <version>0.10</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.doxia</groupId>
              <artifactId>doxia-core</artifactId>
              <version>1.6</version>
              <exclusions>
                <exclusion>
                  <groupId>xerces</groupId>
                  <artifactId>xercesImpl</artifactId>
                </exclusion>
              </exclusions>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <id>rat-check</id>
              <phase>validate</phase>
              <goals>
                <goal>check</goal>
              </goals>
              <configuration>
                <excludes>
                  <exclude>LICENSE*.txt</exclude>
                  <!-- This file should be not be there, but I am excluding it for now -->
                  <exclude>*.rst</exclude>
                  <exclude>*.md</exclude>
                  <exclude>**/*.cdap</exclude>
                  <exclude>**/*.yaml</exclude>
                  <exclude>**/*.md</exclude>
                  <exclude>logs/**</exclude>
                  <exclude>.git/**</exclude>
                  <exclude>.idea/**</exclude>
                  <exclude>**/grok/patterns/**</exclude>
                  <exclude>conf/**</exclude>
                  <exclude>data/**</exclude>
                  <exclude>plugins/**</exclude>
                  <exlcude>**/*.patch</exlcude>
                  <exclude>**/logrotate.d/**</exclude>
                  <exclude>**/limits.d/**</exclude>
                  <exclude>**/*.json</exclude>
                  <exclude>**/*.json.template</exclude>
                  <exclude>**/MANIFEST.MF</exclude>
                  <!-- exclude any hack classes -->
                  <exclude>**/org/apache/hadoop/**</exclude>
                  <!-- exclude resource files-->
                  <exclude>**/resources/**</exclude>
                </excludes>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>3.0.0</version>
          <executions>
            <execution>
              <id>validate</id>
              <phase>process-test-classes</phase>
              <configuration>

                <sourceDirectories>
                  <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                  <sourceDirectory>${project.build.testSourceDirectory}</sourceDirectory>
                </sourceDirectories>

                <configLocation>checkstyle.xml</configLocation>
                <suppressionsLocation>suppressions.xml</suppressionsLocation>
                <encoding>UTF-8</encoding>
                <consoleOutput>true</consoleOutput>
                <failsOnError>true</failsOnError>
                <includeTestSourceDirectory>true</includeTestSourceDirectory>
                <excludes>**/org/apache/cassandra/**,**/org/apache/hadoop/**</excludes>
              </configuration>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>6.19</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>3.3.0</version>
          <extensions>true</extensions>
          <configuration>
            <instructions>
              <_exportcontents>
                io.cdap.plugin.zendesk.*;
              </_exportcontents>
              <Embed-Dependency>*;inline=false;scope=compile</Embed-Dependency>
              <Embed-Transitive>true</Embed-Transitive>
              <Embed-Directory>lib</Embed-Directory>
            </instructions>
          </configuration>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>bundle</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>io.cdap</groupId>
        <artifactId>cdap-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.2</version>
            <extensions>true</extensions>
            <configuration>
              <nexusUrl>https://oss.sonatype.org</nexusUrl>
              <serverId>sonatype.release</serverId>
            </configuration>
          </plugin>
          <!-- Source JAR -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <configuration>
              <excludeResources>true</excludeResources>
            </configuration>
            <executions>
              <execution>
                <id>attach-sources</id>
                <phase>package</phase>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- Javadoc jar -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9.1</version>
            <configuration>
              <additionalparam>-Xdoclint:none</additionalparam>
              <failOnError>false</failOnError>
              <links>
                <link>http://download.oracle.com/javase/${jee.version}/docs/api/</link>
              </links>
              <doctitle>${project.name} ${project.version}</doctitle>
              <bottom>
                <![CDATA[Copyright &#169; {currentYear} <a href="http://cdap.io" target="_blank">CDAP</a> Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2.0</a>.]]>
              </bottom>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadoc</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <configuration>
              <passphrase>${gpg.passphrase}</passphrase>
              <useAgent>${gpg.useagent}</useAgent>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
