Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

multi-module maven project

If I have 6 modules in my project is it possible to build only one out of six ? without commenting out others ?

EDIT

Submodule will not work itselft because or parent tags. I need to install the parent first to make it build. how can I do it without installing parent

like image 237
Gandalf StormCrow Avatar asked Mar 05 '10 15:03

Gandalf StormCrow


1 Answers

is it possible to build only one out of six ? without commenting out others ?

My understanding is that you want to launch maven from the aggregating project (i.e. a reactor build) but only build one module. This is possible using the -pl, --projects project list option (see advanced reactor options):

mvn --projects my-submodule install

This is a very powerful option, especially when combined with --aslo-make (to also build the projects on which the listed modules depend) or the --also-make-dependents (to also build the projects that depends on the listed modules). On the basis of your update, you might want this actually:

mvn --projects my-submodule --also-make install

Launching Maven from the directory of the module you want to build is of course an option but this won't allow you to do the things mentioned above nor to build a subset of all modules. For such use cases, the advanced reactor options are the way to go.

like image 99
Pascal Thivent Avatar answered Sep 22 '22 14:09

Pascal Thivent