<?xml version="1.0" encoding="UTF-8"?>
<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">
  <parent>
    <artifactId>beam-sdks-java-extensions-parent</artifactId>
    <groupId>org.apache.beam</groupId>
    <version>2.3.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>beam-sdks-java-extensions-sql</artifactId>
  <name>Apache Beam :: SDKs :: Java :: Extensions :: SQL</name>
  <description>Beam SQL provides a new interface to generate a Beam pipeline from SQL statement</description>
  <build>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <configuration>
            <testSourceDirectory>${project.basedir}/src/test/</testSourceDirectory>
            <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
          <useIncrementalCompilation>false</useIncrementalCompilation>
          <compilerArgs>
            <arg>-Xlint:-deprecation</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-fmpp-resources</id>
            <phase>initialize</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/codegen</outputDirectory>
              <resources>
                <resource>
                  <directory>src/main/codegen</directory>
                  <filtering>false</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.8</version>
        <executions>
          <execution>
            <id>unpack-parser-template</id>
            <phase>initialize</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.apache.calcite</groupId>
                  <artifactId>calcite-core</artifactId>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/</outputDirectory>
                  <includes>**/Parser.jj</includes>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.googlecode.fmpp-maven-plugin</groupId>
        <artifactId>fmpp-maven-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <id>generate-fmpp-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <cfgFile>${project.build.directory}/codegen/config.fmpp</cfgFile>
              <outputDirectory>target/generated-sources</outputDirectory>
              <templateDirectory>${project.build.directory}/codegen/templates</templateDirectory>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
            <version>2.3.25-incubating</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.9</version>
        <executions>
          <execution>
            <id>add-generated-sources</id>
            <phase>process-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>javacc-maven-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>javacc</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>javacc</goal>
            </goals>
            <configuration>
              <sourceDirectory>${project.build.directory}/generated-sources/</sourceDirectory>
              <includes>
                <include>**/Parser.jj</include>
              </includes>
              <lookAhead>2</lookAhead>
              <isStatic>false</isStatic>
              <outputDirectory>${project.build.directory}/generated-sources/</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>-da</argLine>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <id>bundle-and-repackage</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadeTestJar>true</shadeTestJar>
              <artifactSet>
                <includes>
                  <include>com.google.guava:guava</include>
                  <include>org.apache.calcite:*</include>
                  <include>org.apache.calcite.avatica:*</include>
                  <include>org.codehaus.janino:*</include>
                  <include>com.google.protobuf:*</include>
                </includes>
              </artifactSet>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
              <relocations>
                <relocation>
                  <pattern>com.google.common</pattern>
                  <excludes>
                    <exclude>com.google.common.**.testing.*</exclude>
                  </excludes>
                  <shadedPattern>org.apache.${renderedArtifactId}.repackaged.com.google.common</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.google.thirdparty</pattern>
                  <shadedPattern>org.apache.${renderedArtifactId}.repackaged.com.google.thirdparty</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.google.protobuf</pattern>
                  <shadedPattern>org.apache.${renderedArtifactId}.repackaged.com.google.protobuf</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.calcite</pattern>
                  <shadedPattern>org.apache.${renderedArtifactId}.repackaged.org.apache.calcite</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.codehaus</pattern>
                  <shadedPattern>org.apache.${renderedArtifactId}.repackaged.org.codehaus</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer />
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>direct-runner</id>
      <dependencies>
        <dependency>
          <groupId>org.apache.beam</groupId>
          <artifactId>beam-runners-direct-java</artifactId>
          <version>2.3.0</version>
          <scope>runtime</scope>
        </dependency>
      </dependencies>
      <properties>
        <os.detected.release.version>16.04</os.detected.release.version>
        <os.detected.release.like.ubuntu>true</os.detected.release.like.ubuntu>
        <os.detected.release>ubuntu</os.detected.release>
        <os.detected.name>linux</os.detected.name>
        <os.detected.release.like.debian>true</os.detected.release.like.debian>
        <os.detected.classifier>linux-x86_64</os.detected.classifier>
        <os.detected.arch>x86_64</os.detected.arch>
      </properties>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-sdks-java-core</artifactId>
      <version>2.3.0</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>protobuf-lite</artifactId>
          <groupId>com.google.protobuf</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.1</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>1.7.25</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.25</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-csv</artifactId>
      <version>1.4</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>2.4</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-sdks-java-extensions-join-library</artifactId>
      <version>2.3.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.google.auto.value</groupId>
      <artifactId>auto-value</artifactId>
      <version>1.5.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-sdks-java-io-kafka</artifactId>
      <version>2.3.0</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>spring-expression</artifactId>
          <groupId>org.springframework</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.kafka</groupId>
      <artifactId>kafka-clients</artifactId>
      <version>1.0.0</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>lz4-java</artifactId>
          <groupId>org.lz4</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>1.9.5</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.alibaba</groupId>
      <artifactId>fastjson</artifactId>
      <version>1.2.12</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.beam</groupId>
      <artifactId>beam-runners-direct-java</artifactId>
      <version>2.3.0</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
  <properties>
    <mockito.version>1.9.5</mockito.version>
    <calcite.version>1.13.0</calcite.version>
    <avatica.version>1.10.0</avatica.version>
    <timestamp>${maven.build.timestamp}</timestamp>
    <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
  </properties>
</project>

