| <?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>com.alibaba.blink</groupId> |
| <artifactId>flink-connectors</artifactId> |
| <version>1.5.1</version> |
| <relativePath>..</relativePath> |
| </parent> |
| |
| <artifactId>flink-connector-elasticsearch6_${scala.binary.version}</artifactId> |
| <name>flink-connector-elasticsearch6</name> |
| |
| <packaging>jar</packaging> |
| |
| <!-- Allow users to pass custom connector versions --> |
| <properties> |
| <elasticsearch.version>6.3.1</elasticsearch.version> |
| </properties> |
| |
| <dependencies> |
| |
| <!-- core dependencies --> |
| |
| <dependency> |
| <groupId>com.alibaba.blink</groupId> |
| <artifactId>flink-streaming-java_${scala.binary.version}</artifactId> |
| <version>${project.version}</version> |
| <scope>provided</scope> |
| </dependency> |
| |
| <dependency> |
| <groupId>com.alibaba.blink</groupId> |
| <artifactId>flink-scala_${scala.binary.version}</artifactId> |
| <version>${project.version}</version> |
| <scope>test</scope> |
| <!-- Projects depending on this project, won't depend on flink-table. --> |
| <optional>true</optional> |
| </dependency> |
| |
| <dependency> |
| <groupId>com.alibaba.blink</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 6.x REST Client --> |
| <dependency> |
| <groupId>org.elasticsearch.client</groupId> |
| <artifactId>elasticsearch-rest-high-level-client</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.9.1</version> |
| </dependency> |
| |
| <!-- Used for the Elasticsearch table sink. --> |
| <dependency> |
| <groupId>com.alibaba.blink</groupId> |
| <artifactId>flink-table_${scala.binary.version}</artifactId> |
| <version>${project.version}</version> |
| <scope>provided</scope> |
| <!-- Projects depending on this project, won't depend on flink-table. --> |
| <optional>true</optional> |
| </dependency> |
| |
| <!-- test dependencies --> |
| |
| <dependency> |
| <groupId>com.alibaba.blink</groupId> |
| <artifactId>flink-test-utils_${scala.binary.version}</artifactId> |
| <version>${project.version}</version> |
| <scope>test</scope> |
| </dependency> |
| |
| <dependency> |
| <groupId>com.alibaba.blink</groupId> |
| <artifactId>flink-streaming-java_${scala.binary.version}</artifactId> |
| <version>${project.version}</version> |
| <scope>test</scope> |
| <type>test-jar</type> |
| </dependency> |
| |
| <dependency> |
| <groupId>com.alibaba.blink</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 elasticsearch transport dependency for tests. Netty3 is not here anymore in 6.x |
| --> |
| |
| <dependency> |
| <groupId>org.elasticsearch.client</groupId> |
| <artifactId>transport</artifactId> |
| <version>${elasticsearch.version}</version> |
| <scope>test</scope> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.elasticsearch.plugin</groupId> |
| <artifactId>transport-netty4-client</artifactId> |
| <version>${elasticsearch.version}</version> |
| <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-core</artifactId> |
| <version>2.9.1</version> |
| <scope>test</scope> |
| </dependency> |
| |
| <!-- Elasticsearch table descriptor testing --> |
| <dependency> |
| <groupId>com.alibaba.blink</groupId> |
| <artifactId>flink-table_${scala.binary.version}</artifactId> |
| <version>${project.version}</version> |
| <type>test-jar</type> |
| <scope>test</scope> |
| </dependency> |
| |
| <!-- Elasticsearch table sink factory testing --> |
| <dependency> |
| <groupId>com.alibaba.blink</groupId> |
| <artifactId>flink-json</artifactId> |
| <version>${project.version}</version> |
| <scope>test</scope> |
| </dependency> |
| |
| </dependencies> |
| |
| <profiles> |
| <!-- Create SQL Client uber jars by default --> |
| <profile> |
| <id>sql-jars</id> |
| <activation> |
| <property> |
| <name>!skipSqlJars</name> |
| </property> |
| </activation> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-shade-plugin</artifactId> |
| <executions> |
| <execution> |
| <phase>package</phase> |
| <goals> |
| <goal>shade</goal> |
| </goals> |
| <configuration> |
| <shadedArtifactAttached>true</shadedArtifactAttached> |
| <shadedClassifierName>sql-jar</shadedClassifierName> |
| <filters> |
| <filter> |
| <artifact>*:*</artifact> |
| <!-- It is difficult to find out artifacts that are really required by ES. --> |
| <!-- We use hard filters for now to clean up the SQL JAR. --> |
| <excludes> |
| <exclude>com/carrotsearch/**</exclude> |
| <exclude>com/sun/**</exclude> |
| <exclude>com/tdunning/**</exclude> |
| <exclude>config/**</exclude> |
| <exclude>forbidden/**</exclude> |
| <exclude>joptsimple/**</exclude> |
| <exclude>META-INF/services/com.fasterxml.**</exclude> |
| <exclude>META-INF/services/org.apache.lucene.**</exclude> |
| <exclude>META-INF/services/org.elasticsearch.**</exclude> |
| <exclude>META-INF/versions/**</exclude> |
| <exclude>modules.txt</exclude> |
| <exclude>mozilla/**</exclude> |
| <exclude>org/HdrHistogram/**</exclude> |
| <exclude>org/joda/**</exclude> |
| <exclude>org/tartarus/**</exclude> |
| <exclude>org/yaml/**</exclude> |
| <exclude>plugins.txt</exclude> |
| </excludes> |
| </filter> |
| </filters> |
| <relocations> |
| <!-- Force relocation of all Elasticsearch dependencies. --> |
| <relocation> |
| <pattern>org.apache.commons</pattern> |
| <shadedPattern>org.apache.flink.elasticsearch6.shaded.org.apache.commons</shadedPattern> |
| </relocation> |
| <relocation> |
| <pattern>org.apache.http</pattern> |
| <shadedPattern>org.apache.flink.elasticsearch6.shaded.org.apache.http</shadedPattern> |
| </relocation> |
| <relocation> |
| <pattern>org.apache.lucene</pattern> |
| <shadedPattern>org.apache.flink.elasticsearch6.shaded.org.apache.lucene</shadedPattern> |
| </relocation> |
| <relocation> |
| <pattern>org.elasticsearch</pattern> |
| <shadedPattern>org.apache.flink.elasticsearch6.shaded.org.elasticsearch</shadedPattern> |
| </relocation> |
| <relocation> |
| <pattern>org.apache.logging</pattern> |
| <shadedPattern>org.apache.flink.elasticsearch6.shaded.org.apache.logging</shadedPattern> |
| </relocation> |
| <relocation> |
| <pattern>com.fasterxml.jackson</pattern> |
| <shadedPattern>org.apache.flink.elasticsearch6.shaded.com.fasterxml.jackson</shadedPattern> |
| </relocation> |
| </relocations> |
| <!-- Relocate the table format factory service file. --> |
| <transformers> |
| <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> |
| </transformers> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| </profiles> |
| |
| <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> |
| <version>2.12.2</version> |
| <configuration> |
| <classpathDependencyExcludes> |
| <classpathDependencyExclude>org.apache.logging.log4j:log4j-to-slf4j</classpathDependencyExclude> |
| </classpathDependencyExcludes> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| |
| </project> |