In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail what is the difference between plugins and pluginManagement in Maven. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
The difference between plugins and pluginManagement
The plugin under plugins is really used, while the plugin under plugins under pluginManagement is only a declaration that the parent project cannot be used, and the plugin under pluginManagement can be selected, inherited, overwritten and so on in child projects.
If there are two projects, Project An is the parent of Project B, and its relationship is determined by the relationship of the pom file. The parent pom file snippet of Project An is as follows:
Org.apache.maven.plugins maven-resources-plugin 3.1.0 @ false
If Project B also wants to use this plugin configuration, only the following configuration is required in the child pom file of Project B:
Org.apache.maven.plugins maven-resources-plugin
As you can see, the child item destination pom file omits the version, configuration details and other information, and only needs to specify groupId and artifactId. The other information is inherited from the pom file of the parent project. If the child pom file needs to customize its own plug-in, it can be set separately and will overwrite the content inherited from the parent pom file.
Special note: both dependencies and dependencyManagement are direct child elements under project, but plugins and pluginManagement are direct child elements of build under project.
The relationship between plugins and pluginManagement
Encountered some problems when configuring SonarQube, such as where to write surefire and failsafe
The role of pluginManagement is similar to that of denpendencyManagement, except that denpendencyManagement is used to manage project jar package dependencies and pluginManagement is used to manage plugin.
Unlike the plugins in pom build, the plugin is listed here, and then it is up to the child pom to decide whether to refer to it.
If you want the child module to inherit the use of the parent module's plugin, you still need to declare these plugin in the parent module
By the way, talking about packaging,pom means that the package itself will not be typed as jar.
This is the end of the article on "what is the difference between plugins and pluginManagement in Maven". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.