简体   繁体   中英

maven multi-module project with one plugin module

I am thinking about creating a multi-module project in maven, with one plugin module (ie this module is used as a plugin in other projects, not a dependency).

Question : Is it feasible to have a plugin as a module in a multi module maven project?

It is feasible and it is also documented on the official maven multi-module/reactor page concerning how having a plugin as module is handled by the build (bold is mine):

Because modules within a multi-module build can depend on each other, it is important that The reactor sorts all the projects in a way that guarantees any project is built before it is required.

The following relationships are honoured when sorting projects:

  • a project dependency on another module in the build
  • a plugin declaration where the plugin is another modules in the build
  • a plugin dependency on another module in the build [..]

Once the plugin is installed and deployed, it will then not bring with it any knowledge of its module nature , that is, it will be seen as a normal plugin by the projects that will use it via its unique maven coordinates (GAV).
The same is applied to archetypes, which can be modules of a multi module project and then be used individually.

Also note that you can have - as an example - an aggregator project of projects (then modules) completely unrelated between each other, and, say, just aggregate then because you want to build them all together (often not really meaningful, but useful in some cases).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM