Skip to content

Commit 470d745

Browse files
Marcelo Vanzinsrowen
authored andcommitted
[minor] [examples] Avoid packaging duplicate classes.
Add exclusions and explicit dependencies so that the examples assembly does not duplicate classes already packaged in the main assembly. Also avoid relocating the commons-math3 package since it's already a dependency of spark-core, and thus is already available in the main assembly. Author: Marcelo Vanzin <[email protected]> Closes #5379 from vanzin/examples-deps and squashes the following commits: 12c258e [Marcelo Vanzin] [minor] [examples] Avoid re-packaging unneeded classes.
1 parent 53f6bb1 commit 470d745

File tree

1 file changed

+46
-6
lines changed

1 file changed

+46
-6
lines changed

examples/pom.xml

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@
9090
<groupId>org.apache.spark</groupId>
9191
<artifactId>spark-streaming-zeromq_${scala.binary.version}</artifactId>
9292
<version>${project.version}</version>
93+
<exclusions>
94+
<exclusion>
95+
<groupId>org.spark-project.protobuf</groupId>
96+
<artifactId>protobuf-java</artifactId>
97+
</exclusion>
98+
</exclusions>
9399
</dependency>
94100
<dependency>
95101
<groupId>org.apache.hbase</groupId>
@@ -234,6 +240,7 @@
234240
<dependency>
235241
<groupId>org.apache.commons</groupId>
236242
<artifactId>commons-math3</artifactId>
243+
<scope>provided</scope>
237244
</dependency>
238245
<dependency>
239246
<groupId>com.twitter</groupId>
@@ -262,6 +269,22 @@
262269
<groupId>com.ning</groupId>
263270
<artifactId>compress-lzf</artifactId>
264271
</exclusion>
272+
<exclusion>
273+
<groupId>commons-cli</groupId>
274+
<artifactId>commons-cli</artifactId>
275+
</exclusion>
276+
<exclusion>
277+
<groupId>commons-codec</groupId>
278+
<artifactId>commons-codec</artifactId>
279+
</exclusion>
280+
<exclusion>
281+
<groupId>commons-lang</groupId>
282+
<artifactId>commons-lang</artifactId>
283+
</exclusion>
284+
<exclusion>
285+
<groupId>commons-logging</groupId>
286+
<artifactId>commons-logging</artifactId>
287+
</exclusion>
265288
<exclusion>
266289
<groupId>io.netty</groupId>
267290
<artifactId>netty</artifactId>
@@ -270,17 +293,40 @@
270293
<groupId>jline</groupId>
271294
<artifactId>jline</artifactId>
272295
</exclusion>
296+
<exclusion>
297+
<groupId>net.jpountz.lz4</groupId>
298+
<artifactId>lz4</artifactId>
299+
</exclusion>
273300
<exclusion>
274301
<groupId>org.apache.cassandra.deps</groupId>
275302
<artifactId>avro</artifactId>
276303
</exclusion>
304+
<exclusion>
305+
<groupId>org.apache.commons</groupId>
306+
<artifactId>commons-math3</artifactId>
307+
</exclusion>
308+
<exclusion>
309+
<groupId>org.apache.thrift</groupId>
310+
<artifactId>libthrift</artifactId>
311+
</exclusion>
277312
</exclusions>
278313
</dependency>
279314
<dependency>
280315
<groupId>com.github.scopt</groupId>
281316
<artifactId>scopt_${scala.binary.version}</artifactId>
282317
<version>3.2.0</version>
283318
</dependency>
319+
320+
<!--
321+
The following dependencies are already present in the Spark assembly, so we want to force
322+
them to be provided.
323+
-->
324+
<dependency>
325+
<groupId>org.scala-lang</groupId>
326+
<artifactId>scala-library</artifactId>
327+
<scope>provided</scope>
328+
</dependency>
329+
284330
</dependencies>
285331

286332
<build>
@@ -322,12 +368,6 @@
322368
</excludes>
323369
</filter>
324370
</filters>
325-
<relocations combine.children="append">
326-
<relocation>
327-
<pattern>org.apache.commons.math3</pattern>
328-
<shadedPattern>org.spark-project.commons.math3</shadedPattern>
329-
</relocation>
330-
</relocations>
331371
<transformers>
332372
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
333373
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">

0 commit comments

Comments
 (0)