Difference between and

2019-01-17 14:57发布

问题:

This question already has an answer here:

  • Maven: What is pluginManagement? 4 answers

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!

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

回答1:

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