声纳扫描程序在为我的maven项目运行时抛出以下错误。
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project spring-boot-rest
example: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar failed: A required class was missing while executing
org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar: org/sonar/java/checks/helpers/MethodsHelper
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:sonar-maven plugin:3.4.0.905
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/prakharpandit/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.4.0.905/sonar-maven-plugin-3.4.0.905.jar
[ERROR] urls[1] = file:/Users/prakharpandit/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[2] = file:/Users/prakharpandit/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[3] = file:/Users/prakharpandit/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
[ERROR] urls[4] = file:/Users/prakharpandit/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-api/2.10.0.1189/sonar-scanner-api-2.10.0.1189.jar
[ERROR] urls[5] = file:/Users/prakharpandit/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
答案 0 :(得分:0)
我们将SonarQube中的sonar-java插件从5.1.1更新为5.3后,我们自己的声纳插件出现了同样的错误,因为他们更改了API。
所以你必须更新你的声纳插件中的依赖项。然后你会在那里得到编译错误并修复它们。
https://github.com/SonarSource/sonar-java/commit/3f5df2ec58cb0ca8580b0d07c5bfeffe7318f1f8