Skip to content

Maven插件版本问题 #338

@jsbjfkbsjk

Description

@jsbjfkbsjk

问题摘要 / Issue Summary

最新版本执行mvn命令后报错显示类缺失

版本信息 / Version Information

v1.2.0

浏览器 / Browser

No response

操作系统 / Operating System

Windows 11

发生了什么?/ What happened?

显示类缺失:

Image

项目使用版本为<maven.compiler.version>3.12.1</maven.compiler.version>
插件是org.apache.maven.plugins
maven-compiler-plugin
${maven.compiler.version}

期望的行为 / Expected Behavior

mvn指令成功编译

重现步骤 / Steps to Reproduce

mvn clean install

相关日志 / Relevant Logs

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.12.1:compile (default-compile) on project waterflow-runtime-service: Execution default-compile o
f goal org.apache.maven.plugins:maven-compiler-plugin:3.12.1:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.12.1:compile: org/codehaus/plexus/compiler/util/scan/InclusionScanException
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-compiler-plugin:3.12.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/D:/MAVEN-local%20repository/org/apache/maven/plugins/maven-compiler-plugin/3.12.1/maven-compiler-plugin-3.12.1.jar
[ERROR] urls[1] = file:/D:/MAVEN-local%20repository/org/apache/maven/shared/maven-shared-utils/3.4.2/maven-shared-utils-3.4.2.jar
[ERROR] urls[2] = file:/D:/MAVEN-local%20repository/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar
[ERROR] urls[3] = file:/D:/MAVEN-local%20repository/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.jar
[ERROR] urls[4] = file:/D:/MAVEN-local%20repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[5] = file:/D:/MAVEN-local%20repository/org/codehaus/plexus/plexus-java/1.2.0/plexus-java-1.2.0.jar
[ERROR] urls[6] = file:/D:/MAVEN-local%20repository/org/ow2/asm/asm/9.6/asm-9.6.jar
[ERROR] urls[7] = file:/D:/MAVEN-local%20repository/com/thoughtworks/qdox/qdox/2.0.3/qdox-2.0.3.jar
[ERROR] urls[8] = file:/D:/MAVEN-local%20repository/org/codehaus/plexus/plexus-compiler-api/2.14.2/plexus-compiler-api-2.14.2.jar
[ERROR] urls[9] = file:/D:/MAVEN-local%20repository/org/codehaus/plexus/plexus-compiler-manager/2.14.2/plexus-compiler-manager-2.14.2.jar
[ERROR] urls[10] = file:/D:/MAVEN-local%20repository/org/codehaus/plexus/plexus-xml/3.0.0/plexus-xml-3.0.0.jar
[ERROR] urls[11] = file:/D:/MAVEN-local%20repository/org/codehaus/plexus/plexus-compiler-javac/2.14.2/plexus-compiler-javac-2.14.2.jar
[ERROR] urls[12] = file:/D:/MAVEN-local%20repository/org/codehaus/plexus/plexus-utils/4.0.0/plexus-utils-4.0.0.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]

额外信息 / Additional Context

Image 打开插件源码定位位到错误类为AbstractCompilerMojo,由于在3.12.1版本中引用了新的版本依赖 2.14.2,但是对应的类在新版本中已经删除,此处引用又没有改,导致对应类无法找到,编译时报错。 仓库也有对应的issue:https://github.com/apache/maven-compiler-plugin/issues/877 解决方案:降低版本至3.10.1或提高版本至3.13+都可以解决该问题。

确认事项 / Confirmations

  • 我已经搜索了现有的issues,确认这不是重复问题
    I have searched existing issues and confirmed this is not a duplicate

  • 我已经阅读了项目文档和 FAQ
    I have read the project documentation and FAQ

  • 我提供的信息准确完整
    The information I provided is accurate and complete

  • 我愿意协助测试问题修复 (可选)
    I'm willing to help test the bug fix (optional)

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions