SonarQube“未找到类别”在主AST扫描期间 [英] SonarQube "Class Not Found" during Main AST Scan
问题描述
我的设置:
- Sonarqube 5.1.1
- Sonar-Maven插件2.6(也是试过2.7和3.6)
- JDK 1.7.0_51
错误示例:
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 to be 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
根据 stackoverflow问题,javax.annotation应该是java 1.7的一部分,起来。此外,我已经尝试将它放在本地maven存储库中,但这没有帮助。
According to this stackoverflow question, javax.annotation should be part of java 1.7 and up. Furthermore, I've tried putting it in the local maven repository but that didnt help.
那么Sonar试图找到这个包裹在哪里?有什么帮助?!?
So where is Sonar trying to find this package? Any help?!?
更新:
- 我试过了修改sonar-maven-plugin以包含对javax.annotation的依赖
- 我已经尝试将依赖项放在我的maven的settings.xml中
- 将我的JDK升级到1.8没有帮助。
推荐答案
根据 http://docs.oracle.com/javase/7/docs/api/ index.html?javax / annotation / package-summary.html 您期望的类不是JDK 7的一部分。
According to http://docs.oracle.com/javase/7/docs/api/index.html?javax/annotation/package-summary.html the classes you expect are not part of JDK 7.
您正在寻找的类是此处启动的Google JSR-305实施的一部分https://code.google.com/p/jsr-305/source/browse/trunk/ri/src/main/java/javax/annotation/Nullable.java?r= 24 并转移到Findbugs:
The classes you're looking for are part of google JSR-305 implementation that was initiated here https://code.google.com/p/jsr-305/source/browse/trunk/ri/src/main/java/javax/annotation/Nullable.java?r=24 and which moved to Findbugs:
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.0</version>
</dependency>
根据 https://jcp.org/en/jsr/detail?id=305 JSR-305已完成,但处于休眠状态且尚未添加到了JDK版本。
According to https://jcp.org/en/jsr/detail?id=305 the JSR-305 is finished, but is in dormant status and has not been added to a JDK release yet.
希望它有所帮助。
这篇关于SonarQube“未找到类别”在主AST扫描期间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!