Skip to content

Commit 86c9694

Browse files
authored
[FLINK-24019][build][dist] Package Scala APIs separately
1 parent 7b63482 commit 86c9694

File tree

7 files changed

+175
-17
lines changed

7 files changed

+175
-17
lines changed

flink-dist-scala/pom.xml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
20+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
22+
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<parent>
26+
<groupId>org.apache.flink</groupId>
27+
<artifactId>flink-parent</artifactId>
28+
<version>1.15-SNAPSHOT</version>
29+
<relativePath>..</relativePath>
30+
</parent>
31+
32+
<artifactId>flink-dist-scala_${scala.binary.version}</artifactId>
33+
<name>Flink : Dist-Scala</name>
34+
35+
<dependencies>
36+
<dependency>
37+
<groupId>org.apache.flink</groupId>
38+
<artifactId>flink-scala_${scala.binary.version}</artifactId>
39+
<version>${project.version}</version>
40+
<exclusions>
41+
<exclusion>
42+
<!-- transitive Flink dependencies are provided at runtime -->
43+
<groupId>org.apache.flink</groupId>
44+
<artifactId>*</artifactId>
45+
</exclusion>
46+
</exclusions>
47+
</dependency>
48+
<dependency>
49+
<groupId>org.apache.flink</groupId>
50+
<artifactId>flink-streaming-scala_${scala.binary.version}</artifactId>
51+
<version>${project.version}</version>
52+
<exclusions>
53+
<exclusion>
54+
<!-- transitive Flink dependencies are provided at runtime -->
55+
<groupId>org.apache.flink</groupId>
56+
<artifactId>*</artifactId>
57+
</exclusion>
58+
</exclusions>
59+
</dependency>
60+
61+
<dependency>
62+
<!-- Provided by flink-dist -->
63+
<groupId>org.slf4j</groupId>
64+
<artifactId>slf4j-api</artifactId>
65+
<scope>provided</scope>
66+
</dependency>
67+
<dependency>
68+
<!-- Provided by flink-dist -->
69+
<groupId>com.google.code.findbugs</groupId>
70+
<artifactId>jsr305</artifactId>
71+
<scope>provided</scope>
72+
</dependency>
73+
</dependencies>
74+
75+
<dependencyManagement>
76+
<dependencies>
77+
<dependency>
78+
<!-- Provided by flink-dist -->
79+
<groupId>com.twitter</groupId>
80+
<artifactId>chill-java</artifactId>
81+
<scope>provided</scope>
82+
</dependency>
83+
</dependencies>
84+
</dependencyManagement>
85+
86+
<build>
87+
<plugins>
88+
<plugin>
89+
<groupId>org.apache.maven.plugins</groupId>
90+
<artifactId>maven-shade-plugin</artifactId>
91+
<executions>
92+
<execution>
93+
<id>shade-flink</id>
94+
<phase>package</phase>
95+
<goals>
96+
<goal>shade</goal>
97+
</goals>
98+
<configuration>
99+
<artifactSet>
100+
<includes>
101+
<!-- Explicitly include Flink APIs and Scala.
102+
Transitive dependencies are bundled by _either_ flink-dist(-scala),
103+
and we need to make sure no dependency required for the Scala-free
104+
operation of Flink is bundled in flink-dist-scala. -->
105+
<include>org.apache.flink:*</include>
106+
<include>org.scala-lang*:*</include>
107+
<include>com.twitter:chill_${scala.binary.version}</include>
108+
</includes>
109+
</artifactSet>
110+
</configuration>
111+
</execution>
112+
</executions>
113+
</plugin>
114+
115+
<plugin>
116+
<groupId>org.apache.maven.plugins</groupId>
117+
<artifactId>maven-deploy-plugin</artifactId>
118+
<version>2.4</version><!--$NO-MVN-MAN-VER$-->
119+
<configuration>
120+
<skip>true</skip>
121+
</configuration>
122+
</plugin>
123+
</plugins>
124+
</build>
125+
</project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
flink-dist-scala
2+
Copyright 2014-2021 The Apache Software Foundation
3+
4+
This product includes software developed at
5+
The Apache Software Foundation (http://www.apache.org/).
6+
7+
This project bundles the following dependencies under the Apache Software License 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt)
8+
9+
- com.twitter:chill_2.12:0.7.6
10+
11+
The following dependencies all share the same BSD license which you find under licenses/LICENSE.scala.
12+
13+
- org.scala-lang:scala-compiler:2.12.7
14+
- org.scala-lang:scala-library:2.12.7
15+
- org.scala-lang:scala-reflect:2.12.7
16+
- org.scala-lang.modules:scala-xml_2.12:1.0.6

flink-dist/pom.xml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,20 @@ under the License.
4343

4444
<dependency>
4545
<groupId>org.apache.flink</groupId>
46-
<artifactId>flink-core</artifactId>
46+
<artifactId>flink-dist-scala_${scala.binary.version}</artifactId>
4747
<version>${project.version}</version>
48+
<scope>provided</scope>
4849
</dependency>
4950

5051
<dependency>
5152
<groupId>org.apache.flink</groupId>
52-
<artifactId>flink-java</artifactId>
53+
<artifactId>flink-core</artifactId>
5354
<version>${project.version}</version>
5455
</dependency>
5556

5657
<dependency>
5758
<groupId>org.apache.flink</groupId>
58-
<artifactId>flink-scala_${scala.binary.version}</artifactId>
59+
<artifactId>flink-java</artifactId>
5960
<version>${project.version}</version>
6061
</dependency>
6162

@@ -89,12 +90,6 @@ under the License.
8990
<version>${project.version}</version>
9091
</dependency>
9192

92-
<dependency>
93-
<groupId>org.apache.flink</groupId>
94-
<artifactId>flink-streaming-scala_${scala.binary.version}</artifactId>
95-
<version>${project.version}</version>
96-
</dependency>
97-
9893
<dependency>
9994
<groupId>org.apache.flink</groupId>
10095
<artifactId>flink-metrics-core</artifactId>
@@ -423,6 +418,25 @@ under the License.
423418
<!-- end test dependencies -->
424419
</dependencies>
425420

421+
<dependencyManagement>
422+
<dependencies>
423+
<dependency>
424+
<!-- Provided by flink-dist-scala -->
425+
<groupId>org.apache.flink</groupId>
426+
<artifactId>flink-scala_${scala.binary.version}</artifactId>
427+
<version>${project.version}</version>
428+
<scope>provided</scope>
429+
</dependency>
430+
<dependency>
431+
<!-- Provided by flink-dist-scala -->
432+
<groupId>org.apache.flink</groupId>
433+
<artifactId>flink-streaming-scala_${scala.binary.version}</artifactId>
434+
<version>${project.version}</version>
435+
<scope>provided</scope>
436+
</dependency>
437+
</dependencies>
438+
</dependencyManagement>
439+
426440
<profiles>
427441
<profile>
428442
<!-- Creates/Removes the 'build-target' symlink in the root directory (only Unix systems) -->

flink-dist/src/main/assemblies/bin.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ under the License.
5959
<file>
6060
<source>target/flink-dist_${scala.binary.version}-${project.version}.jar</source>
6161
<outputDirectory>lib/</outputDirectory>
62+
<!-- The jar itself is actually scala-free, so we can remove the scala suffix for clarity. -->
63+
<destName>flink-dist-${project.version}.jar</destName>
6264
<fileMode>0644</fileMode>
6365
</file>
6466

@@ -69,6 +71,14 @@ under the License.
6971
<fileMode>0644</fileMode>
7072
</file>
7173

74+
<!-- Scala APIs -->
75+
<file>
76+
<source>../flink-dist-scala/target/flink-dist-scala_${scala.binary.version}-${project.version}.jar</source>
77+
<outputDirectory>lib/</outputDirectory>
78+
<destName>flink-scala_${scala.binary.version}-${project.version}.jar</destName>
79+
<fileMode>0644</fileMode>
80+
</file>
81+
7282
<!-- Table/SQL Uber JAR -->
7383
<file>
7484
<source>../flink-table/flink-table-uber/target/flink-table-uber_${scala.binary.version}-${project.version}.jar</source>

flink-dist/src/main/resources/META-INF/NOTICE

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ This project bundles the following dependencies under the Apache Software Licens
99
- com.ververica:frocksdbjni:6.20.3-ververica-1.0
1010
- com.google.code.findbugs:jsr305:1.3.9
1111
- com.twitter:chill-java:0.7.6
12-
- com.twitter:chill_2.12:0.7.6
1312
- commons-cli:commons-cli:1.4
1413
- commons-collections:commons-collections:3.2.2
1514
- commons-io:commons-io:2.11.0
@@ -27,13 +26,6 @@ See bundled license files for details.
2726
- com.esotericsoftware.kryo:kryo:2.24.0
2827
- com.esotericsoftware.minlog:minlog:1.2
2928

30-
The following dependencies all share the same BSD license which you find under licenses/LICENSE.scala.
31-
32-
- org.scala-lang:scala-compiler:2.12.7
33-
- org.scala-lang:scala-library:2.12.7
34-
- org.scala-lang:scala-reflect:2.12.7
35-
- org.scala-lang.modules:scala-xml_2.12:1.0.6
36-
3729
This project bundles the following dependencies under the MIT/X11 license.
3830
See bundled license files for details.
3931

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ under the License.
7777
<module>flink-quickstart</module>
7878
<module>flink-contrib</module>
7979
<module>flink-dist</module>
80+
<module>flink-dist-scala</module>
8081
<module>flink-metrics</module>
8182
<module>flink-yarn</module>
8283
<module>flink-yarn-tests</module>

0 commit comments

Comments
 (0)