如何升级maven插件的版本?
我正在使用 maven-ear-plugin 版本 2.3.1 - 我知道有一个新版本可用: http://maven.apache.org/plugins/maven-ear-plugin/
我不知道如何升级到最新版本?
I am using the maven-ear-plugin version 2.3.1 - I know there is a new version available: http://maven.apache.org/plugins/maven-ear-plugin/
I can't work out how to upgrade to the latest version?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
尽管这已经得到了“批准的答案”,但事实证明,有这个 AWESOME versions 插件 处理无休止的版本维护问题。
对于那些懒惰的人来说,这里有一些目标:
Even though this has already gotten the "approved answer", it turns out that there is this AWESOME versions plugin that handles the neverending version maintenance problem.
For those lazy people here are some of its goals:
默认的插件版本继承自Super POM,您可以通过
mvn help: effective-pom
检查它们。如果您想覆盖此处提供的版本,请将其添加到您的 POM 中:
将版本替换为您需要的版本。
The default plugin versions are inherited from the Super POM, and you can check them with
mvn help:effective-pom
.If you want to override the version provided there, add this to your POM:
Replace the version with what you need.
详细介绍了如何选择插件版本,以及有关 superpom 中插件版本的讨论 此处。
实际上当前选择的答案并不完全正确。 我应该
解释为什么这里:
“常规插件部分还允许定义版本和默认配置,这就是混乱所在,在此处定义插件版本和默认配置在技术上是有效的,但我发现遵循此指南更容易理解 pom。 :
如果插件块没有定义执行(从而绑定maven在生命周期中执行某些操作),则将该块放入pluginManagment中”
How the version of a plugin is selected, along with discussion about the plugin versions in the superpom is covered in detail here.
Actually the currently selected answer isn't quite right. It should be
I explained why here:
"The regular plugins section also allows the version and default configuration to be defined, and this is where the confusion lies. It is technically valid to define the plugin version and default configuration here, but I find it easier to grok the pom when following this guideline:
If the plugin block is not defining an execution (and thus binding maven to do something in the lifecycle), put that block in pluginManagment"
一些 Maven 插件仅限于 Maven 版本。 例如,这里的项目通常使用 Maven 2.0.4,它仅限于使用 war 插件 2.0.2 - 这适用于覆盖。 然而,Maven 2.0.9 使用的 2.1-alpha 却没有 - 所以我们必须手动降级。 除非另有说明,Maven 将根据其版本尝试使用插件的最新版本。
Some maven plugins are restricted to maven versions. For example, generally projects around here use Maven 2.0.4, which is restricted to use the war plugin 2.0.2 - this works with overlays. The 2.1-alpha whatever, however, that Maven 2.0.9 uses, does not - so we had to manually downgrade. Maven, unless otherwise instructed, will attempt to use the latest version of a plugin that it can according to its version.