apache/incubator-storm — pull request #22 by ptgoetz (2014-01-27 02:16:27+00:00)
Title: Move shading of the thrift dependency to storm-core

(Addresses STORM-198, and provides potential future path for STORM-129 (AKA #115 -- "Dependency Isolation")

The way we were repackaging the thrift jar before caused maven build problems for a lot of people. We were trying to create a shaded jar (package renaming) in a submodule, then use it as a dependency in other modules. The maven-shade-plugin only allows you to to the `package` or later phases. So trying to run `mvn test` from the root directory would fail because the shaded dependency would not have been created, resulting in compilation errors.

It also wreaked havoc with the maven-release-plugin, making it virtually impossible to release.

This pull requests eliminates that problem by moving the thrift repackaging to the storm-core module.

With this approach, the java imports in source code use the package names as they were before shading, and the package renaming happens when the jar file is built.

This makes it dead easy to isolate dependencies so they don't conflict with user dependencies. For example, a few lines in the storm-core pom could repackage the Guava dependency (which I would actually suggest we do since Guava seems to be the poster child for this type of issue).