<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2006-2018 Talend Inc. - www.talend.com
   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">
  <parent>
    <artifactId>component-runtime</artifactId>
    <groupId>org.talend.sdk.component</groupId>
    <version>0.0.6</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>component-runtime-beam</artifactId>
  <name>Component Runtime :: Beam</name>
  <description>Component bridge to BEAM runtime, TBD: should tcomp own it?</description>

  <properties>
    <talend.build.name>${talend.build.name.base}.beam</talend.build.name>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-runtime-manager</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-runtime-design-extension</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-sdks-java-core</artifactId>
      <version>${beam.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-runners-direct-java</artifactId>
      <version>${beam.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-runners-spark</artifactId>
      <version>${beam.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-sdks-java-io-jdbc</artifactId>
      <version>${beam.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <version>2.4.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-runtime-junit</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <!-- for IT -->
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-runtime-standalone</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-runtime-testing-spark</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>sample</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>${slf4j.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <version>2.0.0</version>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>install</goal>
              <goal>run</goal>
            </goals>
            <configuration>
              <streamLogs>true</streamLogs>
              <projectsDirectory>src/it</projectsDirectory>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
              <settingsFile>src/it/settings.xml</settingsFile>
              <profiles>it-repo</profiles>
              <!-- to debug the packaging
              <mavenOpts>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000</mavenOpts>
              -->
              <showErrors>true</showErrors>
              <pomIncludes>
                <pomInclude>*/pom.xml</pomInclude>
              </pomIncludes>
              <goals>
                <goal>clean</goal>
                <goal>install</goal>
              </goals>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${dependency-plugin.version}</version>
        <executions>
          <execution>
            <id>create-TALEND-INF/dependencies.txt</id>
            <phase>process-resources</phase>
            <goals>
              <goal>list</goal>
            </goals>
            <configuration>
              <includeScope>provided</includeScope>
              <outputFile>${project.build.outputDirectory}/TALEND-INF/beam.dependencies</outputFile>
              <excludeArtifactIds>slf4j-api,findbugs-annotations</excludeArtifactIds>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <version>${gmavenplus.version}</version>
        <executions>
          <execution>
            <id>runner-dependencies</id>
            <phase>process-resources</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <allowSystemExits>true</allowSystemExits>
              <scripts>
                <script>${project.basedir}/src/main/build/RunnerDependencies.groovy</script>
              </scripts>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>${groovy.version}</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
</project>
