我刚刚下载了最新版本,SonarQube 4.3,
然后尝试使用以下命令构建 java-8 项目:
mvn clean install
mvn sonar:sonar
这给了我下面的例外。
谷歌搜索,我的印象是这是一个早期的问题,应该已经解决......?
http://sonarqube.15.x6.nabble.com/Sonar-analyze-Java-1-8-project-Failure-td5023663.html http://sonarqube.15.x6.nabble.com/Sonar-analyze-Java-1-8-project-Failure-td5023663.html
http://jira.codehaus.org/browse/SONARJAVA-482 http://jira.codehaus.org/browse/SONARJAVA-482
SonarQube 4.3 支持 java-8 吗?
或者有什么线索,问题出在哪里?
-------------------------------------------------------
T E S T S
-------------------------------------------------------
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
Caused by: java.lang.RuntimeException: Class java/util/UUID could not be instrumented.
at org.jacoco.agent.rt.internal_6effb9e.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:138)
at org.jacoco.agent.rt.internal_6effb9e.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:99)
at org.jacoco.agent.rt.internal_6effb9e.PreMain.createRuntime(PreMain.java:55)
at org.jacoco.agent.rt.internal_6effb9e.PreMain.premain(PreMain.java:47)
... 6 more
Caused by: java.lang.NoSuchFieldException: $jacocoAccess
at java.lang.Class.getField(Class.java:1690)
at org.jacoco.agent.rt.internal_6effb9e.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:136)
... 9 more
FATAL ERROR in native method: processing of -javaagent failed
Exception in thread "main"
我从 SonarQube 邮件列表中获取了丢失的信息...
总结一下:
要让 Java8 maven-build 在 SonarQube-4.3 上运行:
等待一分钟左右,升级完成...然后关闭+重新启动 sonarqube。
返回升级中心并验证您是否有插件:Java 2.2.1
参考:http://docs.codehaus.org/display/SONAR/JaCoCo+Plugin http://docs.codehaus.org/display/SONAR/JaCoCo+Plugin
就是这样。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)