You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2018/12/18 12:09:00 UTC

[GitHub] zentol closed pull request #7251: [FLINK-11026][ES6] Rework creation of fat sql-client jars

zentol closed pull request #7251: [FLINK-11026][ES6] Rework creation of fat sql-client jars 
URL: https://github.com/apache/flink/pull/7251
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/docs/dev/table/connect.md b/docs/dev/table/connect.md
index 1cc97a39377..e2889764b99 100644
--- a/docs/dev/table/connect.md
+++ b/docs/dev/table/connect.md
@@ -43,7 +43,7 @@ The following table list all available connectors and formats. Their mutual comp
 | Name              | Version             | Maven dependency             | SQL Client JAR         |
 | :---------------- | :------------------ | :--------------------------- | :----------------------|
 | Filesystem        |                     | Built-in                     | Built-in               |
-| Elasticsearch     | 6                   | `flink-connector-elasticsearch6` | [Download](http://central.maven.org/maven2/org/apache/flink/flink-connector-elasticsearch6{{site.scala_version_suffix}}/{{site.version}}/flink-connector-elasticsearch6{{site.scala_version_suffix}}-{{site.version}}-sql-jar.jar) |
+| Elasticsearch     | 6                   | `flink-connector-elasticsearch6` | [Download](http://central.maven.org/maven2/org/apache/flink/flink-sql-connector-elasticsearch6{{site.scala_version_suffix}}/{{site.version}}/flink-sql-connector-elasticsearch6{{site.scala_version_suffix}}-{{site.version}}.jar) |
 | Apache Kafka      | 0.8                 | `flink-connector-kafka-0.8`  | Not available          |
 | Apache Kafka      | 0.9                 | `flink-connector-kafka-0.9`  | [Download](http://central.maven.org/maven2/org/apache/flink/flink-connector-kafka-0.9{{site.scala_version_suffix}}/{{site.version}}/flink-connector-kafka-0.9{{site.scala_version_suffix}}-{{site.version}}-sql-jar.jar) |
 | Apache Kafka      | 0.10                | `flink-connector-kafka-0.10` | [Download](http://central.maven.org/maven2/org/apache/flink/flink-connector-kafka-0.10{{site.scala_version_suffix}}/{{site.version}}/flink-connector-kafka-0.10{{site.scala_version_suffix}}-{{site.version}}-sql-jar.jar) |
diff --git a/flink-connectors/flink-connector-elasticsearch6/pom.xml b/flink-connectors/flink-connector-elasticsearch6/pom.xml
index 57d10795beb..4c79e898bc9 100644
--- a/flink-connectors/flink-connector-elasticsearch6/pom.xml
+++ b/flink-connectors/flink-connector-elasticsearch6/pom.xml
@@ -174,123 +174,6 @@ under the License.
 
 	</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>
-									<artifactSet>
-										<includes>
-											<include>*:*</include>
-										</includes>
-										<excludes>
-											<!-- These dependencies are not required. -->
-											<exclude>com.carrotsearch:hppc</exclude>
-											<exclude>com.tdunning:t-digest</exclude>
-											<exclude>joda-time:joda-time</exclude>
-											<exclude>net.sf.jopt-simple:jopt-simple</exclude>
-											<exclude>org.elasticsearch:jna</exclude>
-											<exclude>org.hdrhistogram:HdrHistogram</exclude>
-											<exclude>org.yaml:snakeyaml</exclude>
-										</excludes>
-									</artifactSet>
-									<filters>
-										<filter>
-											<artifact>org.elasticsearch:elasticsearch</artifact>
-											<excludes>
-												<exclude>config/**</exclude>
-												<exclude>modules.txt</exclude>
-												<exclude>plugins.txt</exclude>
-												<exclude>org/joda/**</exclude>
-											</excludes>
-										</filter>
-										<filter>
-											<artifact>org.elasticsearch.client:elasticsearch-rest-high-level-client</artifact>
-											<excludes>
-												<exclude>forbidden/**</exclude>
-											</excludes>
-										</filter>
-										<filter>
-											<artifact>org.apache.httpcomponents:httpclient</artifact>
-											<excludes>
-												<exclude>mozilla/**</exclude>
-											</excludes>
-										</filter>
-										<filter>
-											<artifact>org.apache.lucene:lucene-analyzers-common</artifact>
-											<excludes>
-												<exclude>org/tartarus/**</exclude>
-											</excludes>
-										</filter>
-										<filter>
-											<artifact>*:*</artifact>
-											<excludes>
-												<!-- exclude Java 9 specific classes as otherwise the shade-plugin crashes -->
-												<exclude>META-INF/versions/**</exclude>
-												<exclude>META-INF/services/com.fasterxml.**</exclude>
-												<exclude>META-INF/services/org.apache.lucene.**</exclude>
-												<exclude>META-INF/services/org.elasticsearch.**</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>
 			<!--
diff --git a/flink-connectors/flink-sql-connector-elasticsearch6/pom.xml b/flink-connectors/flink-sql-connector-elasticsearch6/pom.xml
new file mode 100644
index 00000000000..85b73a9c837
--- /dev/null
+++ b/flink-connectors/flink-sql-connector-elasticsearch6/pom.xml
@@ -0,0 +1,155 @@
+<?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.8-SNAPSHOT</version>
+		<relativePath>..</relativePath>
+	</parent>
+
+	<artifactId>flink-sql-connector-elasticsearch6_${scala.binary.version}</artifactId>
+	<name>flink-sql-connector-elasticsearch6</name>
+
+	<packaging>jar</packaging>
+
+	<!-- Allow users to pass custom connector versions -->
+	<properties>
+		<elasticsearch.version>6.3.1</elasticsearch.version>
+	</properties>
+
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.flink</groupId>
+			<artifactId>flink-connector-elasticsearch6_${scala.binary.version}</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<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>
+								<excludes>
+									<!-- These dependencies are not required. -->
+									<exclude>com.carrotsearch:hppc</exclude>
+									<exclude>com.tdunning:t-digest</exclude>
+									<exclude>joda-time:joda-time</exclude>
+									<exclude>net.sf.jopt-simple:jopt-simple</exclude>
+									<exclude>org.elasticsearch:jna</exclude>
+									<exclude>org.hdrhistogram:HdrHistogram</exclude>
+									<exclude>org.yaml:snakeyaml</exclude>
+								</excludes>
+							</artifactSet>
+							<filters>
+								<!-- Unless otherwise noticed these filters only serve to reduce the size of the resulting
+									jar by removing unnecessary files -->
+								<filter>
+									<artifact>org.elasticsearch:elasticsearch</artifact>
+									<excludes>
+										<exclude>config/**</exclude>
+										<exclude>modules.txt</exclude>
+										<exclude>plugins.txt</exclude>
+										<exclude>org/joda/**</exclude>
+									</excludes>
+								</filter>
+								<filter>
+									<artifact>org.elasticsearch.client:elasticsearch-rest-high-level-client</artifact>
+									<excludes>
+										<exclude>forbidden/**</exclude>
+									</excludes>
+								</filter>
+								<filter>
+									<artifact>org.apache.httpcomponents:httpclient</artifact>
+									<excludes>
+										<exclude>mozilla/**</exclude>
+									</excludes>
+								</filter>
+								<filter>
+									<artifact>org.apache.lucene:lucene-analyzers-common</artifact>
+									<excludes>
+										<exclude>org/tartarus/**</exclude>
+									</excludes>
+								</filter>
+								<filter>
+									<artifact>*:*</artifact>
+									<excludes>
+										<!-- exclude Java 9 specific classes as otherwise the shade-plugin crashes -->
+										<exclude>META-INF/versions/**</exclude>
+										<exclude>META-INF/services/com.fasterxml.**</exclude>
+										<exclude>META-INF/services/org.apache.lucene.**</exclude>
+										<exclude>META-INF/services/org.elasticsearch.**</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>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+
+</project>
diff --git a/flink-connectors/pom.xml b/flink-connectors/pom.xml
index d42247f30e7..807f03d5343 100644
--- a/flink-connectors/pom.xml
+++ b/flink-connectors/pom.xml
@@ -82,6 +82,20 @@ under the License.
 
 	<!-- See main pom.xml for explanation of profiles -->
 	<profiles>
+
+		<!-- Create SQL Client uber jars by default -->
+		<profile>
+			<id>sql-jars</id>
+			<activation>
+				<property>
+					<name>!skipSqlJars</name>
+				</property>
+			</activation>
+			<modules>
+				<module>flink-sql-connector-elasticsearch6</module>
+			</modules>
+		</profile>
+
 		<!-- there's no Kafka 0.8 dependency for Scala 2.12, we only include when building
 		for Scala 2.11 -->
 		<profile>
diff --git a/flink-end-to-end-tests/flink-sql-client-test/pom.xml b/flink-end-to-end-tests/flink-sql-client-test/pom.xml
index d5646688d58..3b04f8f61c9 100644
--- a/flink-end-to-end-tests/flink-sql-client-test/pom.xml
+++ b/flink-end-to-end-tests/flink-sql-client-test/pom.xml
@@ -95,9 +95,8 @@ under the License.
 		<dependency>
 			<!-- Used by maven-dependency-plugin -->
 			<groupId>org.apache.flink</groupId>
-			<artifactId>flink-connector-elasticsearch6_${scala.binary.version}</artifactId>
+			<artifactId>flink-sql-connector-elasticsearch6_${scala.binary.version}</artifactId>
 			<version>${project.version}</version>
-			<classifier>sql-jar</classifier>
 			<scope>provided</scope>
 		</dependency>
 	</dependencies>
@@ -195,9 +194,8 @@ under the License.
 								</artifactItem>
 								<artifactItem>
 									<groupId>org.apache.flink</groupId>
-									<artifactId>flink-connector-elasticsearch6_${scala.binary.version}</artifactId>
+									<artifactId>flink-sql-connector-elasticsearch6_${scala.binary.version}</artifactId>
 									<version>${project.version}</version>
-									<classifier>sql-jar</classifier>
 									<type>jar</type>
 								</artifactItem>
 							</artifactItems>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services