0

Is there a way to specify submodules to build, at the command line?

For example, I have a project:

<modules>
 <module>A</module>
 <module>B</module>
</modules>

and I would like to decide, at runtime in a shell script, wether i want to build A, B, or A and B.

I'd like to issue:

mvn -Dmodules=A,B 

Is there an equivalent command which is possible?

jayunit100
  • 17,388
  • 22
  • 92
  • 167

1 Answers1

2

It's the -pl argument:

mvn -pl A,B

-pl,--projects - Comma-delimited list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path.

Andrey Chaschev
  • 16,160
  • 5
  • 51
  • 68