Skip to content

Commit

Permalink
[FLINK-3032] Fix jackson-core dependency conflict with Hadoop 2.7.1.
Browse files Browse the repository at this point in the history
This commit is also changing how we build the "flink-shaded-hadoop" artifact.
In the past, we were including all Hadoop dependencies into a fat jar, without relocating all of them.
Maven was not able to see Hadoop's dependencies and classes ended up in the classpath multiple times.

With this change, only shaded Hadoop dependencies are included into the jar. The shade plugin will also
remove only the shaded dependencies from the pom file.
  • Loading branch information
rmetzger committed Nov 19, 2015
1 parent 9362200 commit d8ab8bc
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -17,7 +17,7 @@ language: java
matrix:
include:
- jdk: "oraclejdk8"
env: PROFILE="-Dhadoop.version=2.7.0 -Dscala-2.11 -Pinclude-tez -Pinclude-yarn-tests"
env: PROFILE="-Dhadoop.version=2.7.1 -Dscala-2.11 -Pinclude-tez -Pinclude-yarn-tests"
- jdk: "oraclejdk8"
env: PROFILE="-Dhadoop.version=2.5.0 -Pinclude-yarn-tests"
- jdk: "openjdk7"
Expand Down
Expand Up @@ -320,6 +320,8 @@ public static void logEnvironmentInfo(Logger log, String componentName, String[]
}
}

log.info(" Classpath: " + System.getProperty("java.class.path"));

log.info("--------------------------------------------------------------------------------");
}
}
Expand Down
12 changes: 12 additions & 0 deletions flink-shaded-hadoop/pom.xml
Expand Up @@ -72,6 +72,7 @@ under the License.
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>true</createDependencyReducedPom>
<dependencyReducedPomLocation>${project.basedir}/target/dependency-reduced-pom.xml</dependencyReducedPomLocation>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
<filters>
<!-- Exclude signatures -->
<filter>
Expand Down Expand Up @@ -101,6 +102,17 @@ under the License.
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"/>
</transformers>
<artifactSet>
<includes>
<include>com.google.guava:*</include>
<include>com.google.protobuf:*</include>
<include>com.google.code.findbugs:*</include>
<include>asm:asm</include>
<include>io.netty:netty:*</include>
<include>org.apache.curator:*</include>
<include>org.apache.hadoop:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.google</pattern>
Expand Down
19 changes: 19 additions & 0 deletions pom.xml
Expand Up @@ -100,6 +100,7 @@ under the License.
<tez.version>0.6.1</tez.version>
<zookeeper.version>3.4.6</zookeeper.version>
<curator.version>2.8.0</curator.version>
<jackson.version>2.4.2</jackson.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -350,6 +351,24 @@ under the License.
<artifactId>httpclient</artifactId>
<version>4.2</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down

0 comments on commit d8ab8bc

Please sign in to comment.