Skip to content

Commit

Permalink
[FLINK-4861] [build] Package optional project artifacts
Browse files Browse the repository at this point in the history
Package the Flink connectors, metrics, and libraries into subdirectories
of a new opt directory in the release/snapshot tarballs.

This closes apache#3014
  • Loading branch information
greghogan authored and StephanEwen committed Dec 20, 2016
1 parent cefb8db commit 5c76baa
Show file tree
Hide file tree
Showing 4 changed files with 231 additions and 8 deletions.
80 changes: 80 additions & 0 deletions flink-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,72 @@ under the License.
<artifactId>log4j</artifactId>
<scope>compile</scope>
</dependency>

<!-- the following dependencies are packaged in opt/ -->

<!-- start optional Flink metrics reporters -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-metrics-dropwizard</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-metrics-ganglia</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-metrics-graphite</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-metrics-statsd</artifactId>
<version>${project.version}</version>
</dependency>
<!-- end optional Flink metrics reporters -->

<!-- start optional Flink libraries -->
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-cep_2.10</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-cep-scala_2.10</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-gelly_2.10</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-gelly-scala_2.10</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-gelly-examples_2.10</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-ml_2.10</artifactId>
<version>${project.version}</version>
</dependency>
<!-- end optional Flink libraries -->
</dependencies>

<profiles>
Expand Down Expand Up @@ -293,6 +359,20 @@ under the License.
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
<execution>
<id>opt</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assemblies/opt.xml</descriptor>
</descriptors>
<finalName>flink-${project.version}-bin</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down
106 changes: 106 additions & 0 deletions flink-dist/src/main/assemblies/opt.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<!--
~ 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
~
~ https://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.
-->

<assembly
xmlns="https://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 https://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>opt</id>
<formats>
<format>dir</format>
</formats>

<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>flink-${project.version}</baseDirectory>

<files>
<!-- CEP -->
<file>
<source>../flink-libraries/flink-cep/target/flink-cep_2.10-${project.version}.jar</source>
<outputDirectory>opt/</outputDirectory>
<destName>flink-cep_2.10-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>

<file>
<source>../flink-libraries/flink-cep-scala/target/flink-cep-scala_2.10-${project.version}.jar</source>
<outputDirectory>opt/</outputDirectory>
<destName>flink-cep-scala_2.10-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>

<!-- Gelly -->
<file>
<source>../flink-libraries/flink-gelly/target/flink-gelly_2.10-${project.version}.jar</source>
<outputDirectory>opt/</outputDirectory>
<destName>flink-gelly_2.10-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>

<file>
<source>../flink-libraries/flink-gelly-examples/target/flink-gelly-examples_2.10-${project.version}.jar</source>
<outputDirectory>opt/</outputDirectory>
<destName>flink-gelly-examples_2.10-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>

<file>
<source>../flink-libraries/flink-gelly-scala/target/flink-gelly-scala_2.10-${project.version}-jar-with-dependencies.jar</source>
<outputDirectory>opt/</outputDirectory>
<destName>flink-gelly-scala_2.10-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>

<!-- ML -->
<file>
<source>../flink-libraries/flink-ml/target/flink-ml_2.10-${project.version}-jar-with-dependencies.jar</source>
<outputDirectory>opt/</outputDirectory>
<destName>flink-ml_2.10-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>

<!-- Metrics -->
<file>
<source>../flink-metrics/flink-metrics-dropwizard/target/flink-metrics-dropwizard-${project.version}-jar-with-dependencies.jar</source>
<outputDirectory>opt/</outputDirectory>
<destName>flink-metrics-dropwizard-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>

<file>
<source>../flink-metrics/flink-metrics-ganglia/target/flink-metrics-ganglia-${project.version}-jar-with-dependencies.jar</source>
<outputDirectory>opt/</outputDirectory>
<destName>flink-metrics-ganglia-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>

<file>
<source>../flink-metrics/flink-metrics-graphite/target/flink-metrics-graphite-${project.version}-jar-with-dependencies.jar</source>
<outputDirectory>opt/</outputDirectory>
<destName>flink-metrics-graphite-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>

<file>
<source>../flink-metrics/flink-metrics-statsd/target/flink-metrics-statsd-${project.version}.jar</source>
<outputDirectory>opt/</outputDirectory>
<destName>flink-metrics-statsd-${project.version}.jar</destName>
<fileMode>0644</fileMode>
</file>
</files>
</assembly>
34 changes: 26 additions & 8 deletions flink-libraries/flink-gelly-scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@ under the License.
<version>${project.version}</version>
</dependency>

<!-- We need to add this explicitly because through shading the dependency on asm seems
to go away. -->
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>${asm.version}</version>
</dependency>

<!-- the dependencies below are already provided in Flink -->

<dependency>
Expand All @@ -83,6 +75,13 @@ under the License.
<artifactId>scala-compiler</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>${asm.version}</version>
<scope>provided</scope>
</dependency>

<!-- test dependencies -->

Expand Down Expand Up @@ -216,6 +215,25 @@ under the License.
<configLocation>${project.basedir}/../../tools/maven/scalastyle-config.xml</configLocation>
</configuration>
</plugin>

<!-- build a har-with-dependencies, to be included in the 'opt' build folder -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
19 changes: 19 additions & 0 deletions flink-libraries/flink-ml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,25 @@
<configLocation>${project.basedir}/../../tools/maven/scalastyle-config.xml</configLocation>
</configuration>
</plugin>

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 5c76baa

Please sign in to comment.