Say I need (its required) to use fizz-1.0.jar
and buzz-2.3.2.jar
in my Java project. Now, fizz-1.0.jar
depends on foo-0.1.35.jar
, and buzz-2.3.2.jar
depends on foo-4.2.17.jar
.
foo-0.1.35.jar
contains a Widget
class like so:
public class Widget {
public int doSomething(int x) {
return x++;
}
}
foo-4.2.17.jar
contains a heavily modifed version of Widget
:
public class Widget {
public Meh makeStuff() {
return new Meh();
}
}
Unfortunately, both fizz-1.0.jar
and buzz-2.3.2.jar
make heavy use of both versions of Widget
.
I can't just blindly add both versions of foo-x.y.z.jar
to the classpath, because whichever Widget
gets loaded first will only work for either fizz-1.0.jar
or buzz-2.3.2.jar
.
What are my options here? Remember I must have both fizz-1.0.jar
and buzz-2.3.2.jar
, and must satisfy all of their transitive dependencies.