I have a problem in a project that uses has two dependencies. One to a third-party lib, which uses Guava 10.0.1, and one to mine, where I use Guava 14.0.1.
The problem now is, that there is a method in 10.0.1 which was deleted in 14.0.1 and conversly a class that was added after 10.0.1.
So I get either a NoSuchMethodError or an NoClassDefFoundError.
Is there any way around this?
You can either use the older Guava version in your own project, or tell the third-party lib to use the newer version (and pray that that works).
You can use the maven exclude tag to make sure the third-party lib does not use it's own dependency version. Example:
<dependencies>
<dependency>
<groupId>third.party</groupId>
<artifactId>lib</artifactId>
<version>1.0</version>
<scope>compile</scope>
<exclusions>
<exclusion> <!-- declare the exclusion here -->
<groupId>guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
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