<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright © 2015 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>

  <parent>
    <groupId>co.cask.cdap</groupId>
    <artifactId>cdap-etl</artifactId>
    <version>3.2.1</version>
  </parent>

  <artifactId>cdap-etl-lib</artifactId>
  <name>CDAP ETL App Template Library</name>
  <packaging>jar</packaging>

  <dependencies>
    <dependency>
      <groupId>co.cask.cdap</groupId>
      <artifactId>cdap-etl-api</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>co.cask.cdap</groupId>
      <artifactId>cdap-formats</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>co.cask.cdap</groupId>
      <artifactId>cdap-etl-common</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.twitter4j</groupId>
      <artifactId>twitter4j-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.twitter4j</groupId>
      <artifactId>twitter4j-stream</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-mapreduce-client-core</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.avro</groupId>
      <artifactId>avro</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.avro</groupId>
      <artifactId>avro-mapred</artifactId>
      <classifier>hadoop2</classifier>
    </dependency>
    <!-- Start for JMS Source -->
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-jms_1.1_spec</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-core</artifactId>
      <version>5.5.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>log4j</groupId>
          <artifactId>log4j</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- End for JMS Source -->
    <!-- Start for Kafka Source -->
    <dependency>
      <groupId>org.apache.zookeeper</groupId>
      <artifactId>zookeeper</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.twill</groupId>
      <artifactId>twill-core</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.apache.kafka</groupId>
          <artifactId>kafka_2.10</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.kafka</groupId>
      <artifactId>kafka_2.10</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.xerial.snappy</groupId>
          <artifactId>snappy-java</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.xerial.snappy</groupId>
      <artifactId>snappy-java</artifactId>
    </dependency>
    <!-- End for Kafka Source -->
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>amazon-sqs-java-messaging-lib</artifactId>
      <version>1.0.0</version>
    </dependency>
    <dependency>
      <groupId>org.elasticmq</groupId>
      <artifactId>elasticmq-core_2.10</artifactId>
      <version>0.6.3</version>
    </dependency>
    <dependency>
      <groupId>org.elasticmq</groupId>
      <artifactId>elasticmq-rest-sqs_2.10</artifactId>
      <version>0.6.3</version>
    </dependency>
    <dependency>
      <groupId>com.twitter</groupId>
      <artifactId>parquet-avro</artifactId>
      <version>1.6.0</version>
    </dependency>
    <dependency>
      <groupId>net.sf.uadetector</groupId>
      <artifactId>uadetector-resources</artifactId>
      <version>2014.04</version>
    </dependency>
    <!-- Need to add ASM explicitly to override the ASM4 dependency from elasticsearch -->
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm-all</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-validator</groupId>
      <artifactId>commons-validator</artifactId>
      <version>1.4.1</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.5.4</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>batch-source-bundle</id>
            <phase>prepare-package</phase>
            <configuration>
              <classifier>batch-source</classifier>
              <instructions>
                <!-- build bundle jar for batch sources for data quality artifact -->
                <Export-Package>co.cask.cdap.etl.batch.source.*;co.cask.cdap.etl.common;
                  org.apache.avro.mapreduce;parquet.avro</Export-Package>
                <Embed-Dependency>*;inline=false;scope=compile</Embed-Dependency>
                <Embed-Transitive>true</Embed-Transitive>
                <Embed-Directory>lib</Embed-Directory>
              </instructions>
            </configuration>
            <goals>
              <goal>bundle</goal>
            </goals>
          </execution>
          <execution>
            <id>batch-bundle</id>
            <phase>prepare-package</phase>
            <configuration>
              <classifier>batch</classifier>
              <instructions>
                <!-- build bundle jar for batch. excluding realtime-->
                <Export-Package>co.cask.cdap.etl.batch.*;co.cask.cdap.etl.transform.*;
                  co.cask.cdap.etl.validator.*;
                  co.cask.cdap.etl.common;org.apache.avro.mapreduce;parquet.avro.*;parquet.hadoop.*</Export-Package>
                <Embed-Dependency>*;inline=false;scope=compile</Embed-Dependency>
                <Embed-Transitive>true</Embed-Transitive>
                <Embed-Directory>lib</Embed-Directory>
              </instructions>
            </configuration>
            <goals>
              <goal>bundle</goal>
            </goals>
          </execution>
          <execution>
            <id>realtime-bundle</id>
            <phase>prepare-package</phase>
            <configuration>
              <classifier>realtime</classifier>
              <instructions>
                <!-- build bundle jar for realtime. excluding batch-->
                <Export-Package>co.cask.cdap.etl.realtime.*;co.cask.cdap.etl.transform.*;
                  co.cask.cdap.etl.validator.*;co.cask.cdap.etl.common</Export-Package>
                <Embed-Dependency>*;inline=false;scope=compile</Embed-Dependency>
                <Embed-Transitive>true</Embed-Transitive>
                <Embed-Directory>lib</Embed-Directory>
              </instructions>
            </configuration>
           <goals>
              <goal>bundle</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
