When searching for information about stackoverflow, I saw a question similar to mine, but with no real answer here .
I need to migrate my maven project from guava 11.0.2 to guava 14 or higher (I need RangeSet ). I updated my maven pom with the dependency:
<dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>14.0</version> </dependency>
Then I started the maven build and got this error:
[ERROR] xxx.java: cannot find symbol [ERROR] symbol : class Nonnull [ERROR] location: package javax.annotation
I took a closer look and these annotations come with JSR305 , which guava 11.0.2 depends on, since the mvn repository reports this.
I find it strange that guava 14 also depends on JSR305 as mvn repository reports.
If I add a JSR dependency to my pom, then compiling just works just fine:
<dependency> <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> <version>1.3.9</version> <scope>provided</scope> </dependency>
But why should I add this dependency to my pom if guava already depends on it? This seems more like a workaround than a solution, and I would rather understand and make things clean.
Thanks for participating.
source share