Sonarqube9+ 分析gradle项目 报错解决

错误如下:

Starting a Gradle Daemon, 1 incompatible and 3 stopped Daemons could not be reused, use --status for details

> Task :bootBuildInfo
Execution optimizations have been disabled for task ':bootBuildInfo' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: 'G:\IdeaProjects\xxxxxxxx\build\resources\main\META-INF'. Reason: Task ':compileJava' uses this output of task ':bootBuildInfo' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.

> Task :sonarqube FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sonarqube'.
> org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.1/userguide/command_line_interface.html#sec:command_line_warnings

Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.

原因:

由于 SonarQube 9.0 必须使用 JDK11 进行分析。这是 9.0 中的重大更改之一,请参阅官方文档

解决方案

修改JDK版本大于11 + ,或者临时设置 JAVA_HOME 得以解决

set JAVA_HOME = /usr/local/jdk11
./gradlew sonarqube -Dsonar.projectKey=xxxxx -Dsonar.host.url=http://sonarqube.xxxxxx.com -Dsonar.login=e965d7087594566b01b2a43ab5200c2c2ed0a070
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值