The problem I often have, is that I use actual libs in my projects. Now if I use this jar in older projects I have conflicts between the dependencies. The best example is Guava. In some projects I have version 12/13 and actual version of Guava is 18, what I use in newer projects/libs.
It would be nice to pack all dependencies into the jar, so for example if I use Guava 18 it is repacked as own classes in own package tree for this project, so I am able to use the newer jar in my old projects with project dependency for Guava 13 without having any Guava version conflicts, because the imported jar/lib/dependency still uses a repacked Guava version 18.
Does someone know a good way to do this?Any frameworks out there to do this? Hopefully I have explained my problem properly.
Facts (what I use): Java 1.6-1.8 & Ivy & Eclipse Luna
Jar Jar Links https://code.google.com/p/jarjar/ can be used for this. It provides ant task which can be used instead of standard jar task, and has rule element to define the renaming pattern.
Another option maybe Maven Shade plugin, which can do the same http://maven.apache.org/plugins/maven-shade-plugin/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With