<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2017 StreamSets 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>com.streamsets</groupId>
    <artifactId>streamsets-datacollector-root</artifactId>
    <version>3.23.0</version>
    <relativePath>../root</relativePath>
  </parent>
  <groupId>com.streamsets</groupId>
  <artifactId>streamsets-datacollector-container</artifactId>
  <version>3.23.0</version>
  <description>StreamSets Data Collector Container</description>
  <name>StreamSets Data Collector Container</name>
  <packaging>jar</packaging>

  <properties>
    <sdc.log4j.level>DEBUG</sdc.log4j.level>
    <airlift.version>0.7</airlift.version>
    <jexl.version>3.1</jexl.version>
    <maven.deploy.skip>false</maven.deploy.skip>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-container-common</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-upgrader</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-messaging-client</artifactId>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-databind</artifactId>
         </exclusion>
       </exclusions>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-bootstrap</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-aws-support</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-google-cloud-support</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-common</artifactId>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-csv</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.airlift</groupId>
      <artifactId>airline</artifactId>
      <version>${airlift.version}</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-testing</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-stagesupport</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-jexl3</artifactId>
      <version>${jexl.version}</version>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>2.0.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.javassist</groupId>
      <artifactId>javassist</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-mockito</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.4.0-b180830.0359</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.activation</groupId>
      <artifactId>javax.activation-api</artifactId>
      <version>1.2.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-json</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-jvm</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-jmx</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jul-to-slf4j</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.squareup.dagger</groupId>
      <artifactId>dagger</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.squareup.dagger</groupId>
      <artifactId>dagger-compiler</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.conscrypt</groupId>
      <artifactId>conscrypt-openjdk-uber</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty.http2</groupId>
      <artifactId>http2-server</artifactId>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-webapp</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-servlet</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-servlets</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-rewrite</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty.websocket</groupId>
      <artifactId>websocket-api</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-security</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-util</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty.websocket</groupId>
      <artifactId>websocket-servlet</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty.websocket</groupId>
      <artifactId>websocket-client</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.kamranzafar</groupId>
      <artifactId>jtar</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-compress</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty.websocket</groupId>
      <artifactId>websocket-server</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-server</artifactId>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>org.glassfish.hk2.external</groupId>
          <artifactId>javax.inject</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>javax.ws.rs-api</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.containers</groupId>
      <artifactId>jersey-container-servlet</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.containers</groupId>
      <artifactId>jersey-container-servlet-core</artifactId>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>org.glassfish.hk2.external</groupId>
          <artifactId>javax.inject</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-json-jackson</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.test-framework.providers</groupId>
      <artifactId>jersey-test-framework-provider-inmemory</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.test-framework.providers</groupId>
      <artifactId>jersey-test-framework-provider-grizzly2</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.glassfish.jersey.test-framework</groupId>
      <artifactId>jersey-test-framework-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-configuration2</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>javax.inject</groupId>
      <artifactId>javax.inject</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.hk2</groupId>
      <artifactId>hk2-api</artifactId>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>org.glassfish.hk2.external</groupId>
          <artifactId>javax.inject</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.icegreen</groupId>
      <artifactId>greenmail</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.esotericsoftware</groupId>
      <artifactId>kryo</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-minikdc</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.directory.jdbm</groupId>
      <artifactId>apacheds-jdbm1</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers</artifactId>
      <version>${testcontainers.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.swagger</groupId>
      <artifactId>swagger-jersey2-jaxrs</artifactId>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>com.google.code.findbugs</groupId>
          <artifactId>annotations</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.glassfish.jersey.containers</groupId>
          <artifactId>jersey-container-servlet-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.glassfish.jersey.media</groupId>
          <artifactId>jersey-media-multipart</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-pool2</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.directory.server</groupId>
      <artifactId>apacheds-server-integ</artifactId>
      <version>2.0.0-M15</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.apache.directory.shared</groupId>
          <artifactId>shared-ldap-schema</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.directory.api</groupId>
          <artifactId>api-ldap-schema-data</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.carrotsearch</groupId>
      <artifactId>hppc</artifactId>
      <version>0.7.2</version>
    </dependency>

    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-emr-cluster-connection</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>fr.xebia.extras</groupId>
      <artifactId>selma-processor</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>fr.xebia.extras</groupId>
      <artifactId>selma</artifactId>
      <version>${selma.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.avro</groupId>
      <artifactId>avro</artifactId>
      <version>${avro.version}</version>
      <scope>test</scope>
    </dependency>

    <!-- Support bundles -->
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-s3</artifactId>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <excludes>
          <exclude>sdc-buildinfo.properties</exclude>
        </excludes>
        <filtering>false</filtering>
      </resource>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <includes>
          <include>sdc-buildinfo.properties</include>
          <include>sdc-log4j.properties-default</include>
        </includes>
        <filtering>true</filtering>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <!-- flagging the PipelineAnnotationsProcessor to skip processing -->
          <compilerArgument>-Astreamsets.datacollector.annotationsprocessor.skip</compilerArgument>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-agent</id>
            <phase>process-test-classes</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.streamsets</groupId>
                  <artifactId>streamsets-datacollector-bootstrap</artifactId>
                  <version>${project.version}</version>
                  <outputDirectory>${project.build.directory}/agents</outputDirectory>
                  <destFileName>streamsets-datacollector-bootstrap-${project.version}.jar</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${surefire.version}</version>
        <configuration>
          <!-- Sets the VM argument line used when unit tests are run. -->
          <argLine>${surefireArgLine} -javaagent:${project.build.directory}/agents/streamsets-datacollector-bootstrap-${project.version}.jar -Dsun.net.http.allowRestrictedHeaders=true</argLine>
          <systemPropertyVariables>
            <streamsets.test.mode>true</streamsets.test.mode>
            <jersey.config.test.container.factory>org.glassfish.jersey.test.inmemory.InMemoryTestContainerFactory</jersey.config.test.container.factory>
          </systemPropertyVariables>
          <forkCount>1</forkCount>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <executions>
          <!--
              Prepares the property pointing to the JaCoCo runtime agent which
              is passed as VM argument when Maven the Surefire plugin is executed.
          -->
          <execution>
            <id>pre-unit-test</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
            <configuration>
              <!-- Sets the path to the file which contains the execution data. -->
              <destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
              <!--
                  Sets the name of the property containing the settings
                  for JaCoCo runtime agent.
              -->
              <propertyName>surefireArgLine</propertyName>
            </configuration>
          </execution>
          <!--
              Ensures that the code coverage report for unit tests is created after
              unit tests have been run.
          -->
          <execution>
            <id>post-unit-test</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <!-- Sets the path to the file which contains the execution data. -->
              <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
              <!-- Sets the output directory for the code coverage report. -->
              <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
            </configuration>
          </execution>
          <!-- The Executions required by unit tests are omitted. -->
          <!--
              Prepares the property pointing to the JaCoCo runtime agent which
              is passed as VM argument when Maven the Failsafe plugin is executed.
          -->
          <execution>
            <id>pre-integration-test</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
            <configuration>
              <!-- Sets the path to the file which contains the execution data. -->
              <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>
              <!--
                  Sets the name of the property containing the settings
                  for JaCoCo runtime agent.
              -->
              <propertyName>failsafeArgLine</propertyName>
            </configuration>
          </execution>
          <!--
              Ensures that the code coverage report for integration tests after
              integration tests have been run.
          -->
          <execution>
            <id>post-integration-test</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <!-- Sets the path to the file which contains the execution data. -->
              <dataFile>${project.build.directory}/coverage-reports/jacoco-it.exec</dataFile>
              <!-- Sets the output directory for the code coverage report. -->
              <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${failsafe.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
           <!--Sets the VM argument line used when integration tests are run.-->
          <argLine>${failsafeArgLine}</argLine>
          <forkCount>1</forkCount>
          <reuseForks>false</reuseForks>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-maven-plugins</artifactId>
        <executions>
          <execution>
            <id>version-info</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>version-info</goal>
            </goals>
            <configuration>
              <source>
                <directory>${basedir}/src/main</directory>
                <includes>
                  <include>java/**/*.java</include>
                </includes>
              </source>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>release</name>
        </property>
      </activation>
      <properties>
        <!-- Override for log4j level for releases -->
        <sdc.log4j.level>INFO</sdc.log4j.level>
      </properties>
    </profile>
  </profiles>

</project>
