<?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>cupid-root</artifactId>
    <groupId>com.aliyun.odps</groupId>
    <version>3.3.8-public</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.aliyun.odps</groupId>
  <artifactId>cupid-sdk</artifactId>
  <version>3.3.8-public</version>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>compile-protoc</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <mkdir />
                <path>
                  <fileset>
                    <include />
                    <include />
                    <include />
                    <include />
                    <include />
                    <include />
                    <include />
                    <include />
                    <include />
                    <include />
                    <include />
                    <include />
                    <include />
                    <include />
                  </fileset>
                </path>
                <pathconvert />
                <exec>
                  <arg />
                  <arg />
                  <arg />
                </exec>
              </tasks>
              <sourceRoot>target/generated-sources</sourceRoot>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>false</shadedArtifactAttached>
              <artifactSet>
                <includes>
                  <include>com.aliyun.odps.cupid.interaction.jetty:unused</include>
                  <include>com.aliyun.odps.cupid.interaction.jline:unused</include>
                  <include>org.eclipse.jetty:jetty-io</include>
                  <include>org.eclipse.jetty:jetty-util</include>
                  <include>org.eclipse.jetty.websocket:websocket-client</include>
                  <include>org.eclipse.jetty.websocket:websocket-api</include>
                  <include>org.eclipse.jetty.websocket:websocket-common</include>
                  <include>jline:jline</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>org.eclipse.jetty</pattern>
                  <shadedPattern>com.aliyun.odps.cupid.interaction.jetty</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>jline</pattern>
                  <shadedPattern>com.aliyun.odps.cupid.interaction.jline</shadedPattern>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>protobuf-2.5-relocation</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-shade-plugin</artifactId>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>shade</goal>
                </goals>
                <configuration>
                  <minimizeJar>true</minimizeJar>
                  <shadedArtifactAttached>false</shadedArtifactAttached>
                  <createDependencyReducedPom>false</createDependencyReducedPom>
                  <artifactSet>
                    <includes>
                      <include>com.aliyun.odps.cupid.interaction.jetty:unused</include>
                      <include>com.aliyun.odps.cupid.interaction.jline:unused</include>
                      <include>org.eclipse.jetty:jetty-io</include>
                      <include>org.eclipse.jetty:jetty-util</include>
                      <include>org.eclipse.jetty.websocket:websocket-client</include>
                      <include>org.eclipse.jetty.websocket:websocket-api</include>
                      <include>org.eclipse.jetty.websocket:websocket-common</include>
                      <include>jline:jline</include>
                      <include>com.google.protobuf:*</include>
                    </includes>
                  </artifactSet>
                  <relocations>
                    <relocation>
                      <pattern>org.eclipse.jetty</pattern>
                      <shadedPattern>com.aliyun.odps.cupid.interaction.jetty</shadedPattern>
                    </relocation>
                    <relocation>
                      <pattern>jline</pattern>
                      <shadedPattern>com.aliyun.odps.cupid.interaction.jline</shadedPattern>
                    </relocation>
                    <relocation>
                      <pattern>com.google.protobuf</pattern>
                      <shadedPattern>com.aliyun.odps.cupid.com.google.protobuf</shadedPattern>
                    </relocation>
                  </relocations>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <version>2.5.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.github.rholder</groupId>
      <artifactId>guava-retrying</artifactId>
      <version>2.0.0</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>guava</artifactId>
          <groupId>com.google.guava</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>14.0.1</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.aliyun.odps</groupId>
      <artifactId>odps-sdk-core</artifactId>
      <version>0.30.8-public</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>protobuf-java</artifactId>
          <groupId>com.google.protobuf</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.2.4</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.2</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>1.10</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.17</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
      <version>1.9.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.arrow</groupId>
      <artifactId>arrow-vector</artifactId>
      <version>0.10.0</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>netty-common</artifactId>
          <groupId>io.netty</groupId>
        </exclusion>
        <exclusion>
          <artifactId>netty-buffer</artifactId>
          <groupId>io.netty</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
</project>

