aboutsummaryrefslogtreecommitdiff
path: root/pom.xml
diff options
context:
space:
mode:
authorJosh Rosen <joshrosen@databricks.com>2016-01-10 19:59:01 -0800
committerJosh Rosen <joshrosen@databricks.com>2016-01-10 19:59:01 -0800
commit3ab0138b0fe0f9208b4b476855294a7c729583b7 (patch)
treec2946df3470e825087fa61f4ca0928dd45736942 /pom.xml
parent3119206b7188c23055621dfeaf6874f21c711a82 (diff)
downloadspark-3ab0138b0fe0f9208b4b476855294a7c729583b7.tar.gz
spark-3ab0138b0fe0f9208b4b476855294a7c729583b7.tar.bz2
spark-3ab0138b0fe0f9208b4b476855294a7c729583b7.zip
[SPARK-12734][BUILD] Fix Netty exclusion and use Maven Enforcer to prevent future bugs
Netty classes are published under multiple artifacts with different names, so our build needs to exclude the `io.netty:netty` and `org.jboss.netty:netty` versions of the Netty artifact. However, our existing exclusions were incomplete, leading to situations where duplicate Netty classes would wind up on the classpath and cause compile errors (or worse). This patch fixes the exclusion issue by adding more exclusions and uses Maven Enforcer's [banned dependencies](https://maven.apache.org/enforcer/enforcer-rules/bannedDependencies.html) rule to prevent these classes from accidentally being reintroduced. I also updated `dev/test-dependencies.sh` to run `mvn validate` so that the enforcer rules can run as part of pull request builds. /cc rxin srowen pwendell. I'd like to backport at least the exclusion portion of this fix to `branch-1.5` in order to fix the documentation publishing job, which fails nondeterministically due to incompatible versions of Netty classes taking precedence on the compile-time classpath. Author: Josh Rosen <rosenville@gmail.com> Author: Josh Rosen <joshrosen@databricks.com> Closes #10672 from JoshRosen/enforce-netty-exclusions.
Diffstat (limited to 'pom.xml')
-rw-r--r--pom.xml57
1 files changed, 56 insertions, 1 deletions
diff --git a/pom.xml b/pom.xml
index 0eac212754..cbed36c1ea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -519,6 +519,12 @@
<groupId>${akka.group}</groupId>
<artifactId>akka-remote_${scala.binary.version}</artifactId>
<version>${akka.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>${akka.group}</groupId>
@@ -762,6 +768,10 @@
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -822,6 +832,10 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -923,6 +937,10 @@
<artifactId>netty</artifactId>
</exclusion>
<exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
@@ -947,6 +965,10 @@
<artifactId>netty</artifactId>
</exclusion>
<exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
@@ -976,6 +998,10 @@
<artifactId>netty</artifactId>
</exclusion>
<exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
@@ -1004,6 +1030,10 @@
<artifactId>netty</artifactId>
</exclusion>
<exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
@@ -1032,6 +1062,10 @@
<artifactId>netty</artifactId>
</exclusion>
<exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
@@ -1046,6 +1080,16 @@
<artifactId>zookeeper</artifactId>
<version>${zookeeper.version}</version>
<scope>${hadoop.deps.scope}</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.netty</groupId>
+ <artifactId>netty</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
@@ -1771,7 +1815,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
- <version>1.4</version>
+ <version>1.4.1</version>
<executions>
<execution>
<id>enforce-versions</id>
@@ -1786,6 +1830,17 @@
<requireJavaVersion>
<version>${java.version}</version>
</requireJavaVersion>
+ <bannedDependencies>
+ <excludes>
+ <exclude>io.netty:netty</exclude>
+ <exclude>org.jboss.netty</exclude>
+ </excludes>
+ <includes>
+ <!-- Required by Flume sink tests -->
+ <include>io.netty:netty:3.4.0.Final:*:test</include>
+ </includes>
+ <searchTransitive>true</searchTransitive>
+ </bannedDependencies>
</rules>
</configuration>
</execution>