gpt4 book ai didi

关于 build.plugins.plugin.version 的 Maven 3 警告

转载 作者:行者123 更新时间:2023-12-03 04:00:37 24 4
gpt4 key购买 nike

自从我更新到 Maven 3 以来,我在每次构建时都会收到以下警告消息:

如何消除这些警告?

[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for proj:id:jar:3.1
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ line 195, column 15
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 204, column 15
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 227, column 15
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ line 215, column 15
[WARNING] 'reporting.plugins.plugin.version' for org.codehaus.mojo:jdepend-maven-plugin is missing. @ line 271, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

最佳答案

添加<version> <plugin> 之后的元素<artifactId>在你的pom.xml文件。找到以下文本:

<plugin>
<artifactId>maven-compiler-plugin</artifactId>

添加版本标签:

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>

警告应该得到解决。

关于这一点:

'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing

许多人提到了问题发生的原因,但没有提出解决方案。我所需要做的就是进入我的项目的 POM 文件,并添加 <version>标签如上所示。

要发现版本号,一种方法是在 Maven 完成运行后查看其输出。如果缺少版本号,Maven 将显示其默认版本:

[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ entities ---

获取该版本号(如上面的 2.3.2 所示)并将其添加到您的 POM,如图所示。

关于关于 build.plugins.plugin.version 的 Maven 3 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4123044/

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