gpt4 book ai didi

java - 未指定 Maven 插件版本

转载 作者:太空狗 更新时间:2023-10-29 22:34:41 25 4
gpt4 key购买 nike

我刚刚注意到插件的版本在 maven 中是可选的。我仍然可以在不指定的情况下构建我的模块。让我们以 maven-bundle-plugin 为例。

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
....
</plugin>

我已经编写了一个没有父级的简单 pom.xml 来尝试这个,所以不涉及 pluginManagement。我还检查了 maven-model-builder 中的 super super pom-4.0.0.xml 以确认 maven-bundle-plugin 不存在。此插件版本未在任何地方指定。

maven如何确定取哪个版本?

最佳答案

来自 Maven 3.x Compatibility Notes :

Automatic Plugin Version Resolution

When a plugin was invoked without an explicit version given in the POM or on the command line, Maven 2.x used to pick the latest version available where the latest version could either be a release or a snapshot. For the sake of stability, Maven 3.x prefers the latest release version over the latest snapshot version.

Given the threat of non-reproducible builds imposed by automatic plugin version resolution, this feature is scheduled for removal as far as plugin declarations in the POM are concerned. Users of Maven 3.x will find it output a warning when missing plugin versions are detected to encourage the addition of plugin versions to the POM or one of its parent POMs. The Enforcer rule requirePluginVersions can be used additionally check for missing plugin versions in the POM.

关于java - 未指定 Maven 插件版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17239394/

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