简体   繁体   中英

maven multimodule build: package vs. install

What is the true way of building multi-module maven project: via package or via install if NONE of the modules will be a dependency for another project? I think in this case package is the only way to build it but I see how people IMO abuse the install goal. And I don't get why.

Is there any official considerations on how the multi-module project should be built?

UPD: I have only one explanation. Sometimes people just unaware of -pl , -am and -rf maven options. Thus it leads them to install the modules' artifacts into repository when they want to build part of the reactor.

if none of the projects is a dependency of any other project you have a weird setup. why build them together if they don't belong together?

Sometimes people just unaware of -pl, -am and -rf maven options

in a normal setup, where there are dependencies between modules, these options (at least -rf ) don't work if the modules aren't installed.

OK, you are using a dependency management system without dependencies. Yes, you can use package instead of install . But you are not avoiding bad usage patterns, you are either missing out on features or grouping things together that don't belong together.

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