本文介绍了无法执行目标org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar(default-cli)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我安装了Sonar PMD插件,此后出现以下错误:
I installed Sonar PMD plugin and after which i am getting the following error:
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar (default-cli) on project bpm-parent:
Execution default goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar failed:
An API incompatibility was encountered while executing org.sonarscanner.maven:sonar-maven-plugin:3.0.1:sonar:
java.lang.NoSuchMethodError: org.sonar.plugins.java.api.JavaResourceLocator.classpath()Ljava/llection;
-----------------------------------------------------
realm = plugin>org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/Users/yogas/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-plugin/3.0.1/sonar-maven-plugin-3.0.1.jar
urls[1] = file:/C:/Users/yogas/.m2/repository/org/apache/maven/shared/maven-dependency-tree/2.2/maven-dependency-tree-2.2.jar
urls[2] = file:/C:/Users/yogas/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.ja
urls[3] = file:/C:/Users/yogas/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
urls[4] = file:/C:/Users/yogas/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar
urls[5] = file:/C:/Users/yogas/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[6] = file:/C:/Users/yogas/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
urls[7] = file:/C:/Users/yogas/.m2/repository/org/sonarsource/sonar-runner/sonar-runner-api/2.5.1/sonar-runner-api-2.5.1.jar
urls[8] = file:/C:/Users/yogas/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar
urls[9] = file:/C:/Users/yogas/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar
urls[10] = file:/C:/Users/yogas/.m2/repository/com/google/code/findbugs/jsr305/2.0.3/jsr305-2.0.3.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]
推荐答案
这似乎很简单:
通常,您应该检查插件版本矩阵,以确保您要安装的插件版本与服务器版本兼容.
Generally, you should check the Plugin Version Matrix to make sure the plugin version you want to install is compatible with your version of the server.
但是,特别是在这种情况下,它似乎是PMD插件的版本与其所依赖的Java插件的版本之间的不兼容(谢谢Julien!).尝试确保同时安装了最新版本.
Specifically in this case however, it seems to be an incompatibility between the version of the PMD plugin and the version of the Java plugin, on which it is dependent (Thanks Julien!). Try making sure you have the latest versions of both installed.
这篇关于无法执行目标org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.1:sonar(default-cli)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!