<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.streamsets</groupId>
    <artifactId>streamsets-datacollector-root</artifactId>
    <version>3.23.3</version>
    <relativePath>../root</relativePath>
  </parent>
  <groupId>com.streamsets</groupId>
  <artifactId>streamsets-datacollector-dist</artifactId>
  <version>3.23.3</version>
  <description>StreamSets Data Collector Distribution</description>
  <name>StreamSets Data Collector Dist</name>
  <packaging>pom</packaging>

  <properties>
    <!-- trick to avoid pulling files from 'ui' & 'docs' if their profiles are not active -->
    <ui.dist-dir>${basedir}/src/main/emptydir</ui.dist-dir>
    <docs.dist-dir>${basedir}/src/main/emptydir</docs.dist-dir>
    <edge.dist-dir>${basedir}/dist/target/edge-binaries</edge.dist-dir>
    <sdc.log4j.level>DEBUG</sdc.log4j.level>
    <snappy.version>1.0.5</snappy.version>
    <datacollector-edge.version>3.23.3</datacollector-edge.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-api</artifactId>
      <scope>compile</scope>
    </dependency>

    <!--
      This needs to be loaded by api classloader, (since slf4j classes are blacklisted by BlacklistClassloader)
      but not really required for the api project, so add it in the api-lib directory during assembly
    -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jul-to-slf4j</artifactId>
      <version>${slf4j.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-cli</artifactId>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-container-common</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-container</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-bootstrap</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.4.0-b180830.0359</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>javax.activation</groupId>
      <artifactId>javax.activation-api</artifactId>
      <version>1.2.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.xerial.snappy</groupId>
      <artifactId>snappy-java</artifactId>
      <version>${snappy.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.reload4j</groupId>
      <artifactId>reload4j</artifactId>
      <version>${reload4j.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-reload4j</artifactId>
      <version>${slf4j.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-metadata-generator</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk18on</artifactId>
      <version>${bouncycastle.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpkix-jdk18on</artifactId>
      <version>${bouncycastle.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpg-jdk18on</artifactId>
      <version>${bouncycastle.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-cluster-bootstrap-api</artifactId>
      <exclusions>
		  <exclusion>
			  <groupId>org.apache.zookeeper</groupId>
			  <artifactId>zookeeper</artifactId>
		  </exclusion>
	  </exclusions>
      <scope>provided</scope>
    </dependency>
    <dependency>
       <groupId>com.streamsets</groupId>
       <artifactId>streamsets-datacollector-cluster-bootstrap</artifactId>
       <exclusions>
		  <exclusion>
			  <groupId>org.apache.zookeeper</groupId>
			  <artifactId>zookeeper</artifactId>
		  </exclusion>
	  </exclusions>
       <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-mapr-cluster-bootstrap</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-mapr-cluster-bootstrap_2_2</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.streamsets</groupId>
      <artifactId>streamsets-datacollector-mesos-bootstrap</artifactId>
      <exclusions>
		  <exclusion>
			  <groupId>org.apache.zookeeper</groupId>
			  <artifactId>zookeeper</artifactId>
		  </exclusion>
	  </exclusions>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!--
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-dependency</id>
            <phase>compile</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.streamsets</groupId>
                  <artifactId>streamsets-datacollector-edge</artifactId>
                  <classifier>linux-arm</classifier>
                  <version>${datacollector-edge.version}</version>
                  <type>tgz</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>target/edge-binaries</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>com.streamsets</groupId>
                  <artifactId>streamsets-datacollector-edge</artifactId>
                  <classifier>linux-amd64</classifier>
                  <version>${datacollector-edge.version}</version>
                  <type>tgz</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>target/edge-binaries</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>com.streamsets</groupId>
                  <artifactId>streamsets-datacollector-edge</artifactId>
                  <classifier>darwin-amd64</classifier>
                  <version>${datacollector-edge.version}</version>
                  <type>tgz</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>target/edge-binaries</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>com.streamsets</groupId>
                  <artifactId>streamsets-datacollector-edge</artifactId>
                  <classifier>windows-amd64</classifier>
                  <version>${datacollector-edge.version}</version>
                  <type>zip</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>target/edge-binaries</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      -->

      <!-- TODO: remove remote test and keep tests that do not have dependencies with external resources -->
      <!-- This is an integration test that needs AWS and Azure services -->
      <!-- <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.6.0</version>
        <configuration>
          <skip>${skipTests}</skip>
        </configuration>
        <executions>
          <execution>
            <id>default-cli</id>
            <goals>
              <goal>exec</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <executable>src/test/libexec/run_tests.sh</executable>
            </configuration>
          </execution>
        </executions>
      </plugin> -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>dist</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <appendAssemblyId>false</appendAssemblyId>
              <attach>false</attach>
              <finalName>streamsets-datacollector-${project.version}</finalName>
              <descriptors>
                <descriptor>src/main/assemblies/data-collector.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
          <execution>
            <id>legacy-libs</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <appendAssemblyId>false</appendAssemblyId>
              <attach>false</attach>
              <finalName>streamsets-datacollector-${project.version}-legacy</finalName>
              <descriptors>
                <descriptor>src/main/assemblies/legacy-libs.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>

    <profile>
      <id>all-libs</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>release</name>
        </property>
      </activation>
      <dependencies>
      </dependencies>
    </profile>
    <profile>
      <id>ui</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>release</name>
        </property>
      </activation>
      <properties>
        <!-- trick to avoid pulling UI files if the 'ui' profile is not active -->
        <sdc.ui.dist-dir>${basedir}/../datacollector-ui/target/dist</sdc.ui.dist-dir>
        <!-- TODO: for now we copy committed generated docs  -->
        <docs.dist-dir>${basedir}/../docs/generated</docs.dist-dir>
      </properties>
      <!--
       Since we're not using really a "jar" from the UI this is mainly to force maven
       to build the modules in the right order - UI before the dist. See SDC-3760 for
       more details
      -->
      <dependencies>
        <dependency>
          <groupId>com.streamsets</groupId>
          <artifactId>streamsets-datacollector-ui</artifactId>
          <scope>provided</scope>
          <type>pom</type>
        </dependency>
      </dependencies>
    </profile>
    <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>

    <profile>
      <id>docs</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>release</name>
        </property>
      </activation>
      <properties>
        <docs.dist-dir>${basedir}/../docs/target/dita/out</docs.dist-dir>
      </properties>
      <dependencies>
        <dependency>
          <groupId>com.streamsets</groupId>
          <artifactId>streamsets-datacollector-docs</artifactId>
          <scope>compile</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <!-- COMMENTING OUT JAVADOC GENERATION -->
          <!--<plugin>-->
            <!--<artifactId>maven-javadoc-plugin</artifactId>-->
            <!--<version>2.10.1</version>-->
            <!--<executions>-->
              <!--<execution>-->
                <!--<id>javadoc</id>-->
                <!--<phase>prepare-package</phase>-->
                <!--<goals>-->
                  <!--<goal>javadoc</goal>-->
                <!--</goals>-->
                <!--<configuration>-->
                  <!--<linksource>false</linksource>-->
                  <!--<quiet>true</quiet>-->
                  <!--<verbose>false</verbose>-->
                  <!--<charset>UTF-8</charset>-->

                  <!--<excludePackageNames>com.streamsets.pipeline.api.impl:com.streamsets.pipeline.sdk.annotationsprocessor</excludePackageNames>-->

                  <!--<groups>-->
                    <!--<group>-->
                      <!--<title>Pipeline API</title>-->
                      <!--<packages>-->
                        <!--com.streamsets.pipeline.api:com.streamsets.pipeline.api.base-->
                      <!--</packages>-->
                    <!--</group>-->
                    <!--<group>-->
                      <!--<title>Pipeline Stage SDK API</title>-->
                      <!--<packages>-->
                        <!--com.streamsets.pipeline.sdk-->
                      <!--</packages>-->
                    <!--</group>-->
                  <!--</groups>-->

                  <!--<includeDependencySources>true</includeDependencySources>-->
                  <!--<dependencySourceIncludes>-->
                    <!--<dependencySourceInclude>com.streamsets:streamsets-datacollector-api</dependencySourceInclude>-->
                    <!--<dependencySourceInclude>com.streamsets:streamsets-datacollector-sdk</dependencySourceInclude>-->
                  <!--</dependencySourceIncludes>-->
                <!--</configuration>-->
              <!--</execution>-->
            <!--</executions>-->
          <!--</plugin>-->
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
