I've got a classpath conflict because of Guava. Dropwizard 0.4.0 already
comes with two Guava versions. 12.0 on which Dropwizard depends
directly, and r07 through jackson-datatype-guava. Now, in order to have
a useful app I need to bring in my code from other projects, which
apparently includes transitively yet another two different Guava
versions. The end result is that I have four Guava versions on classpath
and I can't run the app because they're incompatible.
I've tried upgrading libraries in my own code hoping the problem will go
away. Unfortunately my app will simply break with too much upgrade work
needed in order to fix it.
I was thinking that maybe I can maintain a forked version of Dropwizard
in which I would relocate "com.google.common" to some other package
using the maven-shade-plugin. This is what elasticsearch is doing and
where I got the idea from.
As I don't have experience with the maven-shade-plugin, is it possible
to do this for Dropwizard? If yes, how?
I've tried adding this snippet[0] at the end of dropwizard-core/pom.xml
but it dies with an error in dropwizard-db. I've added the same snippet
in dropwizard-db/poml.xml too, but then it dies with some "invalid
signature" error. Adding it to the parent POM won't work either.
Any help, including an alternative solution to the classpath problem,
would be greatly appreciated. I'm kind of losing my minds with this.
[0]:
https://gist.github.com/2974019
--
Ionuț G. Stan |
http://igstan.ro