You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Dependency Shading has been extended in this pull request: https://github.com/apache/flink/pull/454

Before the change, Flink had a "flink-shaded" module which contained a relocated guava dependency. All guava dependencies inside the individual modules were set to the 'provided' scope.

 

There are three areas where we shade our dependencies:

Internal shading is about hiding some of Hadoop's dependencies from Flink. 
Flink supports a broad range of Hadoop versions, which depend on different versions of certain dependencies.
Right now, we shade

  • everything in the com.google namespace (guava and protobuf) 
  • org.objectweb.asm
  • org.jboss.netty

They all end up in org.apache.flink.hadoop.shaded.*
The shading of hadoop dependencies is done in "flink-shaded-hadoop" and its sub-modules.
Originally, we wanted to to handle the different hadoop versions inside this module, but the maven-shade-plugin doesn't properly support maven build profiles when creating the dependency reduced pom (a pom file which doesn't contain the shaded dependencies. In our case they won't contain guava, asm or netty anymore). 
To resolve that, the "flink-shaded-hadoop" is the parent of some version specific flink-shaded-hadoop modules. The parent contains the configuration of the shading (the sub modules will inherit the configuration).
The submodules have the following purpose:

  • flink-shaded-hadoop1 Is for all hadoop 0.2X and 1.XX versions. It contains only 
  • flink-shaded-hadoop2
  • flink-shaded-include-yarn
  • flink-shaded-include-yarn-tests



the maven-shade-plugin will take the output of the regular build process (a jar file), add all depending cl 

 

  • No labels