blob: 708ff6b47d8a5702d1afbb4b748bc6c8fb984166 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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>org.apache.flink</groupId>
<artifactId>flink-connectors</artifactId>
<version>1.5.1</version>
<relativePath>..</relativePath>
</parent>
<artifactId>flink-connector-elasticsearch5_${scala.binary.version}</artifactId>
<name>flink-connector-elasticsearch5</name>
<packaging>jar</packaging>
<!-- Allow users to pass custom connector versions -->
<properties>
<elasticsearch.version>5.1.2</elasticsearch.version>
</properties>
<dependencies>
<!-- core dependencies -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-elasticsearch-base_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<exclusions>
<!-- Elasticsearch Java Client has been moved to a different module in 5.x -->
<exclusion>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Dependency for Elasticsearch 5.x Java Client -->
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<!--
Elasticsearch 5.x uses Log4j2 and no longer detects logging implementations, making
Log4j2 a strict dependency. The following is added so that the Log4j2 API in
Elasticsearch 5.x is routed to SLF4J. This way, user projects can remain flexible
in the logging implementation preferred.
-->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>2.7</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-elasticsearch-base_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
</exclusion>
</exclusions>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<!--
Including Log4j2 dependencies for tests is required for the
embedded Elasticsearch nodes used in tests to run correctly.
-->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.7</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!--
For the tests, we need to exclude the Log4j2 to slf4j adapter dependency
and let Elasticsearch directly use Log4j2, otherwise the embedded Elasticsearch node
used in tests will fail to work.
In other words, the connector jar is routing Elasticsearch 5.x's Log4j2 API's to SLF4J,
but for the test builds, we still stick to directly using Log4j2.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<classpathDependencyExcludes>
<classpathDependencyExclude>org.apache.logging.log4j:log4j-to-slf4j</classpathDependencyExclude>
</classpathDependencyExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>shade-flink</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadeTestJar>false</shadeTestJar>
<artifactSet>
<includes>
<include>*:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.carrotsearch</pattern>
<shadedPattern>org.apache.flink.streaming.connectors.elasticsearch5.shaded.com.carrotsearch</shadedPattern>
</relocation>
<relocation>
<pattern>com.fasterxml</pattern>
<shadedPattern>org.apache.flink.streaming.connectors.elasticsearch5.shaded.com.fasterxml</shadedPattern>
</relocation>
<relocation>
<pattern>com.github</pattern>
<shadedPattern>org.apache.flink.streaming.connectors.elasticsearch5.shaded.com.github</shadedPattern>
</relocation>
<relocation>
<pattern>com.sun</pattern>
<shadedPattern>org.apache.flink.streaming.connectors.elasticsearch5.shaded.com.sun</shadedPattern>
</relocation>
<relocation>
<pattern>com.tdunning</pattern>
<shadedPattern>org.apache.flink.streaming.connectors.elasticsearch5.shaded.com.tdunning</shadedPattern>
</relocation>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>org.apache.flink.streaming.connectors.elasticsearch5.shaded.io.netty</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache</pattern>
<shadedPattern>org.apache.flink.streaming.connectors.elasticsearch5.shaded.org.apache</shadedPattern>
<excludes>
<!-- keep flink classes as they are (exceptions as above) -->
<exclude>org.apache.flink.**</exclude>
<exclude>org.apache.log4j.**</exclude> <!-- provided -->
</excludes>
</relocation>
<relocation>
<pattern>org.HdrHistogram</pattern>
<shadedPattern>org.apache.flink.streaming.connectors.elasticsearch5.shaded.org.HdrHistogram</shadedPattern>
</relocation>
<relocation>
<pattern>org.jboss</pattern>
<shadedPattern>org.apache.flink.streaming.connectors.elasticsearch5.shaded.org.jboss</shadedPattern>
</relocation>
<relocation>
<pattern>org.joda</pattern>
<shadedPattern>org.apache.flink.streaming.connectors.elasticsearch5.shaded.org.joda</shadedPattern>
</relocation>
<relocation>
<pattern>org.tartarus</pattern>
<shadedPattern>org.apache.flink.streaming.connectors.elasticsearch5.shaded.org.tartarus</shadedPattern>
</relocation>
<relocation>
<pattern>org.yaml</pattern>
<shadedPattern>org.apache.flink.streaming.connectors.elasticsearch5.shaded.org.yaml</shadedPattern>
</relocation>
<relocation>
<pattern>joptsimple</pattern>
<shadedPattern>org.apache.flink.streaming.connectors.elasticsearch5.shaded.joptsimple</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*</artifact>
<excludes>
<exclude>log4j.properties</exclude>
<exclude>config/favicon.ico</exclude>
<exclude>mozilla/**</exclude>
<exclude>META-INF/maven/com*/**</exclude>
<exclude>META-INF/maven/io*/**</exclude>
<exclude>META-INF/maven/joda*/**</exclude>
<exclude>META-INF/maven/net*/**</exclude>
<exclude>META-INF/maven/org.an*/**</exclude>
<exclude>META-INF/maven/org.apache.h*/**</exclude>
<exclude>META-INF/maven/org.apache.commons/**</exclude>
<exclude>META-INF/maven/org.apache.flink/force-shading/**</exclude>
<exclude>META-INF/maven/org.apache.logging*/**</exclude>
<exclude>META-INF/maven/org.e*/**</exclude>
<exclude>META-INF/maven/org.h*/**</exclude>
<exclude>META-INF/maven/org.j*/**</exclude>
<exclude>META-INF/maven/org.y*/**</exclude>
</excludes>
</filter>
<!--
Since we relocate the dependency, the paths specified in the providers file
will be incorrect. We exclude it here, and re-package a new providers file
with the correct re-located paths.
-->
<filter>
<artifact>org.apache.logging.log4j:log4j-to-slf4j</artifact>
<excludes>
<exclude>META-INF/log4j-provider.properties</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>