1
當我試圖在我的項目往往我收到以下錯誤運行mvn sonar:sonar
命令:不兼容性:org.codehaus.plexus。 .exception.ComponentLookupException
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-c
li) on project ProjectName: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-mav
en-plugin:3.2:sonar failed: Unable to load the mojo 'sonar' in the plugin 'org.sonarsource.scanner.m
aven:sonar-maven-plugin:3.2' due to an API incompatibility: org.codehaus.plexus.component.repository
.exception.ComponentLookupException: org/sonarsource/scanner/maven/SonarQubeMojo : Unsupported major
.minor version 52.0
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:3.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/U39/.m2/repository/org/sonarsource/scanner/maven/sonar-maven-pl
ugin/3.2/sonar-maven-plugin-3.2.jar
[ERROR] urls[1] = file:/C:/Users/U39/.m2/repository/org/apache/maven/shared/maven-dependency-tre
e/2.2/maven-dependency-tree-2.2.jar
[ERROR] urls[2] = file:/C:/Users/U39/.m2/repository/org/codehaus/plexus/plexus-component-annotat
ions/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[3] = file:/C:/Users/U39/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aeth
er-util-0.9.0.M2.jar
[ERROR] urls[4] = file:/C:/Users/U39/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.
4/plexus-sec-dispatcher-1.4.jar
[ERROR] urls[5] = file:/C:/Users/U39/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus
-cipher-1.4.jar
[ERROR] urls[6] = file:/C:/Users/U39/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plex
us-utils-3.0.22.jar
[ERROR] urls[7] = file:/C:/Users/U39/.m2/repository/org/sonarsource/scanner/api/sonar-scanner-ap
i/2.8/sonar-scanner-api-2.8.jar
[ERROR] urls[8] = file:/C:/Users/U39/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2
.6.jar
[ERROR] urls[9] = file:/C:/Users/U39/.m2/repository/com/google/code/findbugs/jsr305/2.0.3/jsr305
-2.0.3.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] -> [Help 1]
我經歷了這麼多的資源或鏈接不見了,才知道是兼容性問題來自只有當我們使用不同版本的java編譯器。雖然我在Java 8上運行我的Java代碼,但我仍然可以看到上述錯誤。
版本詳情:
的Java:1.8
的Maven:3.0.5
SonarQube:5.4
有人可以幫我這個問題。
您有以下問題:'不支持的主要 .minor版本52.0'? – khmarbaise
@khmarbaise是的,我確實有這個問題,並嘗試用java8,但沒有工作。 –
您是否檢查過mvn --version以驗證maven **是否真的使用Java 8? –