Maven‘ pom.xml’中 < plugins > 和 < pluginManagement > 标记之间的区别

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

<plugins><pluginManagement>有什么不同?

50748 次浏览

From Maven documentation:

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.

You can look at a better answer