user10840312
user10840312

Reputation:

mvn -pl <name> -am command

I have the following command, which I'm using to build a specific microservice (<ms-name>):

./mvnw -DskipTests clean install -pl <ms-name> -am

clean, instal, and -DskipTest are clear. But I don't understand what -pl and -am are doing.

logs:

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] <utils-1>                                                          [jar]
[INFO] <utils-2>                                                          [jar]
[INFO] <ms-name>                                                          [jar]

and after it starts executing clean install on , , and in the end <ms-name>

I have checked the pom.xml but could not see the relations somewhere. My question is: What are -pl and -am and where I can find this 'order' building relation between <ms-name>, <utils-1>, and <utils-2>?

Upvotes: 2

Views: 2382

Answers (1)

Sam
Sam

Reputation: 4284

From documentation,

-pl is,

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

-am is,

If project list is specified, also build projects required by the list

where I can find this 'order' building relation ..?

It is handled by reactor (and internal program within maven) which collects all the available modules to build, sorts the projects into the correct build order and builds the selected projects in order.

To get understand more about maven reactor, here is a StackOverflow answer which is more detailed enough.

What is the "reactor" in Maven?

Upvotes: 3

Related Questions