java - SonarQube "Class Not Found" during Main AST Scan -


my setup:

  • sonarqube 5.1.1
  • sonar-maven plugin 2.6 (also tried 2.7 , 3.6)
  • jdk 1.7.0_51

example of error:

16:00:54 [info] [23:00:54.219] sensor javasquidsensor 16:00:55 [info] [23:00:55.030] java main files ast scan... 16:00:55 [info] [23:00:55.030] 1532 source files analyzed 16:00:58 [error] [23:00:57.927] class not found: javax.annotation.nullable 16:00:58 [error] [23:00:57.928] class not found: javax.annotation.checkreturnvalue 16:00:58 [error] [23:00:58.114] class not found: javax.annotation.nullable 

according stackoverflow question, javax.annotation should part of java 1.7 , up. furthermore, i've tried putting in local maven repository didnt help.

so sonar trying find package? help?!?

update:

  • i've tried modifying sonar-maven-plugin include dependency on javax.annotation
  • i've tried putting dependency in maven's settings.xml
  • upgrading jdk 1.8 has not helped.

according http://docs.oracle.com/javase/7/docs/api/index.html?javax/annotation/package-summary.html classes expect not part of jdk 7.

the classes you're looking part of google jsr-305 implementation initiated here https://code.google.com/p/jsr-305/source/browse/trunk/ri/src/main/java/javax/annotation/nullable.java?r=24 , moved findbugs:

<dependency>   <groupid>com.google.code.findbugs</groupid>   <artifactid>jsr305</artifactid>   <version>3.0.0</version> </dependency> 

according https://jcp.org/en/jsr/detail?id=305 jsr-305 finished, in dormant status , has not been added jdk release yet.

hope helps.


Comments