You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tr...@apache.org on 2016/02/23 15:21:46 UTC
[3/9] flink git commit: [FLINK-3459] [build] Fix conflicting
dependencies commons-collections, commons-beanutils and commons-beanutils-core
[FLINK-3459] [build] Fix conflicting dependencies commons-collections, commons-beanutils and commons-beanutils-core
The Hadoop dependencies have a dependency on commons-configuration which pulls in transitively the commons-collection, commons-beanutils and common-beanutils-core depedencies. Commons-beanutils and commons-collection contain classes which live in the same namespace. They are also binary compatible but not binary identical. This is a problem for the sbt assembly plugin which checks for binary identity. In order to solve the problem, we bump the commons-configuration version to 1.7 so that only commons-beanutils is pulled in. This is necessary, because the transitive promotion of dependencies of the shade plugin only excludes the commons-beanutils dependency only from the directly depending dependency. All parent dependencies won't have the exclusion. This is a problem for SBT which will pull the dependency as part of one of the parents, then. Moreover, we replace commons-beanutils by commons-beanutils-bean-collections which contains only the non-conflicting classes wrt commons-collect
ions.
This closes #1682.
Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/3b47ad2b
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/3b47ad2b
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/3b47ad2b
Branch: refs/heads/master
Commit: 3b47ad2ba18351841ad19af28b0945a1f96299db
Parents: b204888
Author: Till Rohrmann <tr...@apache.org>
Authored: Wed Feb 17 15:41:43 2016 +0100
Committer: Till Rohrmann <tr...@apache.org>
Committed: Tue Feb 23 15:20:07 2016 +0100
----------------------------------------------------------------------
flink-core/pom.xml | 6 ------
.../flink-shaded-hadoop2/pom.xml | 12 +++++++++++
pom.xml | 22 ++++++++++++++++----
3 files changed, 30 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/3b47ad2b/flink-core/pom.xml
----------------------------------------------------------------------
diff --git a/flink-core/pom.xml b/flink-core/pom.xml
index 694f629..fc91156 100644
--- a/flink-core/pom.xml
+++ b/flink-core/pom.xml
@@ -40,12 +40,6 @@ under the License.
<artifactId>flink-annotations</artifactId>
<version>${project.version}</version>
</dependency>
-
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <!-- managed version -->
- </dependency>
<dependency>
<groupId>com.esotericsoftware.kryo</groupId>
http://git-wip-us.apache.org/repos/asf/flink/blob/3b47ad2b/flink-shaded-hadoop/flink-shaded-hadoop2/pom.xml
----------------------------------------------------------------------
diff --git a/flink-shaded-hadoop/flink-shaded-hadoop2/pom.xml b/flink-shaded-hadoop/flink-shaded-hadoop2/pom.xml
index c642653..cf95198 100644
--- a/flink-shaded-hadoop/flink-shaded-hadoop2/pom.xml
+++ b/flink-shaded-hadoop/flink-shaded-hadoop2/pom.xml
@@ -141,9 +141,21 @@ under the License.
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-guice</artifactId>
</exclusion>
+ <!--We have to exclude beanutils because it is overlapping with commons-collections-->
+ <exclusion>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ </exclusion>
</exclusions>
</dependency>
+ <!--Here we include all the missing parts of beanutils which are not included in the
+ commons-collections dependency-->
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils-bean-collections</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
http://git-wip-us.apache.org/repos/asf/flink/blob/3b47ad2b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 67e5296..ae4b77d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -207,11 +207,25 @@ under the License.
<version>2.4</version>
</dependency>
- <!-- common-collections is used by us and by hadoop, so we need to define a common version -->
+ <!-- common-beanutils-bean-collections is used by flink-shaded-hadoop2 -->
<dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2.2</version>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils-bean-collections</artifactId>
+ <version>1.8.3</version>
+ </dependency>
+
+ <!--We have to bump the commons-configuration to version 1.7 because Hadoop uses per
+ default 1.6. This version has the problem that it depends on commons-beanutils-core and
+ commons-digester. Commons-digester depends on commons-beanutils. Both dependencies are
+ contains classes of commons-collections. Since the dependency reduced pom does not
+ exclude commons-beanutils from commons-configuration, sbt would pull it in again. The
+ solution is setting the version of commons-configuration to 1.7 which also depends on
+ common-beanutils. Consequently, the dependency reduced pom will also contain an
+ exclusion for commons-beanutils for commons-configuration. -->
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>1.7</version>
</dependency>
<dependency>