< plugins>之间的差异和< pluginManagement>标记在Maven`pom.xml`中
配置我的 pom.xml
时,我必须配置一个插件。我发现的是< plugin>
标签可以插入< plugins>
或< pluginManagement>
元素。我很困惑!
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!
< plugins>
和< pluginManagement>
?
来自 Maven文档:
From Maven documentation:
pluginManagement :是一个沿侧插件看到的元素。插件管理以大致相同的方式包含插件元素,除了不是为此特定项目构建配置插件信息,它旨在配置从此继承的项目构建。但是,这仅配置在子节点的plugins元素中实际引用的插件。孩子们有权覆盖插件管理定义。
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.
你可以看看更好的答案