未能执行目标 org.sonarsource.scanner.maven:sonar-maven-plugin: 3.2:sonar [英] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: 3.2:sonar

查看:42
本文介绍了未能执行目标 org.sonarsource.scanner.maven:sonar-maven-plugin: 3.2:sonar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能帮我解决以下错误.

Can anyone help me in getting solution for the below error.

下面是要配置的组件版本

Below are the version of the components to configure

  1. SonarQube 5.1.2
  2. Soanr-Runner 2.4
  3. Java 1.7 [我只能使用 1.7,因为我的代码只支持 1.7]
  4. mavn 3.3.9
  5. sonar-cobertura-plugin-1.6.3
  6. sonar-findbugs-plugin-3.3
  7. cobertura 2.6

执行命令

mvn -fn -e org.sonarsource.scanner.maven:sonar-maven-plugin:RELEASE:sonar -Dsonar.jdbc.url="jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance" -Dsonar.host.url=http://localhost:9000 -DskipTests

在控制台窗口中出现错误

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:
3.2:sonar (default-cli) on project NWT_Core: Execution default-cli of goal org.s
onarsource.scanner.maven:sonar-maven-plugin:3.2:sonar failed: Unable to load the
 mojo 'sonar' in the plugin 'org.sonarsource.scanner.maven:sonar-maven-plugin:3.
2' due to an API incompatibility: org.codehaus.plexus.component.repository.excep
tion.ComponentLookupException: org/sonarsource/scanner/maven/SonarQubeMojo : Unsupported major.minor version 52.0 

推荐答案

无论您使用什么编译代码,SonarQube 分析都应该使用 Java 8运行.您只需要使用不同的 JDK 版本进行编译和分析.要么,要么用 Java 8 和 -target 1.7 做任何事情.

Regardless of what you compile your code with, the SonarQube analysis should be run with Java 8. You simply need to use different JDK versions for the compile and analysis. Either that, or do everything with Java 8 and -target 1.7.

这篇关于未能执行目标 org.sonarsource.scanner.maven:sonar-maven-plugin: 3.2:sonar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆