运行声纳时我得到以下错误:
[11:32:40]: [:sonarTask] 11:32:40.862 [QUIET] [system.out] INFO: EXECUTION FAILURE
[11:32:40]: [:sonarTask] 11:32:40.862 [QUIET] [system.out] INFO: ------------------------------------------------------------------------
[11:32:40]: [:sonarTask] 11:32:40.862 [QUIET] [system.out] Total time: 1.031s
[11:32:40]: [:sonarTask] 11:32:40.956 [QUIET] [system.out] Final Memory: 1M/15M
[11:32:40]: [:sonarTask] 11:32:40.956 [QUIET] [system.out] INFO: ------------------------------------------------------------------------
[11:32:40]: [:sonarTask] 11:32:40.956 [ERROR] [system.err] ERROR: Error during Sonar runner execution
[11:32:40]: [:sonarTask] 11:32:40.956 [ERROR] [system.err] ERROR: Unable to execute Sonar
[11:32:40]: [:sonarTask] 11:32:40.956 [ERROR] [system.err] ERROR: Caused by: The plugin python is not supported with Java 1.6.0_21
[11:32:40]: [:sonarTask] 11:32:40.956 [ERROR] [system.err] ERROR: Caused by: org/sonar/plugins/python/PythonPlugin : Unsupported major.minor version 51.0
[11:32:40]: [:sonarTask] 11:32:40.956 [ERROR] [system.err] ERROR:
[11:32:40]: [:sonarTask] 11:32:40.956 [ERROR] [system.err] ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
[11:32:40]: [:sonarTask] 11:32:40.956 [ERROR] [system.err] ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
[11:32:41]: [:sonarTask] 11:32:41.096 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
它失败了,因为java 1.6与python插件不兼容,但我需要保留它。 我的java源代码是1.6,它必须是这个。
在我的声纳属性中,我有以下内容:
sonar.java.source=1.6
sonar.java.target=1.6
我必须做出哪些改变?将java目标更改为1.7? java目标是运行声纳时使用的java版本吗?
答案 0 :(得分:1)
您仍然可以分析使用1.6编译的代码,但您必须使用Java 7或更高版本来运行分析过程。
您的属性是正确的。只需升级运行分析器的Java版本。