2015-11-20 81 views
0

SonarQube 5.2,sonar-maven-plugin 2.7.1,Apache Maven 3.3.9(但我測試了所有的3.3.x,甚至到了3.2.5,都以相同的方式失敗)。SonarQube 5.2:java.lang.NoSuchMethodError:

mvn -T1 -Dsonar-maven-plugin.version=2.7.1 -Dsonar.host.url=http://sonar.example.com -e -B sonar:sonar 
    ... 
    [INFO] SonarQube version: 5.2 
    ... 
    [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (default-cli) on project blame: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar failed: An API incompatibility was encountered while executing org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar: java.lang.NoSuchMethodError: org.sonar.api.resources.Project.getPom()Lorg/apache/maven/project/MavenProject; 
    ... 
    [ERROR] ----------------------------------------------------- 
    [ERROR] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:2.7.1 
    [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy 
    [ERROR] urls[0] = file:/home/jieryn/.m2/repository/org/codehaus/mojo/sonar-maven-plugin/2.7.1/sonar-maven-plugin-2.7.1.jar 
    [ERROR] urls[1] = file:/home/jieryn/.m2/repository/org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.jar 
    [ERROR] urls[2] = file:/home/jieryn/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar 
    [ERROR] urls[3] = file:/home/jieryn/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar 
    [ERROR] urls[4] = file:/home/jieryn/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar 
    [ERROR] urls[5] = file:/home/jieryn/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar 
    [ERROR] urls[6] = file:/home/jieryn/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.4/plexus-sec-dispatcher-1.4.jar 
    [ERROR] urls[7] = file:/home/jieryn/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.jar 
    [ERROR] urls[8] = file:/home/jieryn/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar 
    [ERROR] urls[9] = file:/home/jieryn/.m2/repository/org/sonarsource/sonar-runner/sonar-runner-api/2.5-RC1/sonar-runner-api-2.5-RC1.jar 
    [ERROR] urls[10] = file:/home/jieryn/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar 
    [ERROR] urls[11] = file:/home/jieryn/.m2/repository/com/google/guava/guava/10.0.1/guava-10.0.1.jar 
    [ERROR] urls[12] = file:/home/jieryn/.m2/repository/com/google/code/findbugs/jsr305/2.0.3/jsr305-2.0.3.jar 
... 
Caused by: org.apache.maven.plugin.PluginContainerException: An API incompatibility was encountered while executing org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar: java.lang.NoSuchMethodError: org.sonar.api.resources.Project.getPom()Lorg/apache/maven/project/MavenProject; 

UPDATE:聲納5.2,FindBugs的3.3,1.1的Git,Java的3.7.1的JavaScript 2.8,沒有更新被列爲可用於這些插件。

+1

請給出完整的日誌和安裝插件的列表。謝謝。 –

回答

1

您使用的插件與SonarQube 5.2不兼容。請檢查Plugin Version Matrix

+0

在我的情況下,它是聲納5.3引起java.lang.NoSuchMethodError的JMeter:org.sonar.api.resources.Project.getFileSystem()Lorg/sonar/api/resources/ProjectFileSystem; –