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,048
  • 21
  • 85
  • 157

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
  • 15,735
  • 5
  • 46
  • 65