Java Maven `pom.xml` 中 <plugins> 和 <pluginManagement> 标签的区别

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26736876/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 03:11:58  来源:igfitidea点击:

Difference between <plugins> and <pluginManagement> tag in Maven `pom.xml`

javamavenpom.xml

提问by CALTyang

While configuring my pom.xml, I had to configure a plugin. What I found out is that the <plugin>tag may be inserted inside either <plugins>or <pluginManagement>elements. I am confused!

在配置 my 时pom.xml,我必须配置一个插件。我发现<plugin>标签可以插入到<plugins><pluginManagement>元素中。我很迷惑!

What is the difference between <plugins>and <pluginManagement>?

<plugins>和 和有<pluginManagement>什么区别?

采纳答案by Sergii Getman

From Maven documentation:

Maven 文档

pluginManagement: is an element that is seen along side plugins. Plugin Management contains plugin elements in much the same way, except that rather than configuring plugin information for this particular project build, it is intended to configure project builds that inherit from this one. However, this only configures plugins that are actually referenced within the plugins element in the children. The children have every right to override pluginManagement definitions.

pluginManagement: 是一个与插件一起看到的元素。插件管理以大致相同的方式包含插件元素,除了不是为此特定项目构建配置插件信息,而是旨在配置从该项目构建继承的项目构建。但是,这仅配置在子项的 plugins 元素中实际引用的插件。孩子们有权覆盖 pluginManagement 定义。

You can look at a better answer

你可以看看更好的答案