I’ve got a Maven build for an OSGI project I’m working on. I’d like to use some functionality from Google’s guava-osgi library, version 11.0.1.
One of the projects I’m depending on has a dependency on guava-osgi, version 10.0.0. I know that having multiple versions for a particular dependency is feasible, but I’m having a little trouble with it.
Specifying the dependency on 11.0.1 in my project’s pom compiles just fine, but when I run my unit tests, Java’s pulling in version 10.0.0, which results in a runtime error. Specifically, one of the classes in 11.0.1 has the same name as an interface in 10.0.0, so Java barfs when I try to instantiate it.
Is there a way to do this elegantly?
mvn dependency:treeguava-osgi:10.0.0versionguava-osgi:10.0.0from test scope