gpt4 book ai didi

java - 不兼容 :org. codehaus.plexus。 .exception.ComponentLookupException

转载 作者:行者123 更新时间:2023-11-30 07:58:54 25 4
gpt4 key购买 nike

当我尝试在我的项目上运行 mvn sonar:sonar 命令时,我经常遇到以下错误:

[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
声纳管:5.4

谁能帮我解决这个问题。

最佳答案

Maven 本身必须使用 Java 8 来执行那个声纳 Maven 插件。使用 mvn --version 检查它是否使用 Java 8。如果没有,请调整您的 JAVA_HOME 环境变量以指向 Java 8 安装。

关于java - 不兼容 :org. codehaus.plexus。 .exception.ComponentLookupException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39957406/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com