How to build a parent maven module and choose the number of modules?

I have a multi-module maven project.

To create only the parent element, I run mvn package -N (where -N is "non-recursive").

To create several modules, I run mvn package -pl api,servie (where -pl are "projects").

How can I combine these two to create api, service and parent?

+8
source share
2 answers
 mvn package -pl api,service --also-make 

(where --also-make creates dependencies)

+15
source

How about mvn package -pl api,service,. ('.' indicating the project in the current directory) or mvn package -pl api,service,:parent (where "parent" is the artifact of the parent module).

The -pl arguments can be either a relative path to the directory containing the maven module, or a coordinate in the form [groupId]:artifactId module in the current project. If no groupId is provided, the groupId of the constructed pump is used.

+4
source

Source: https://habr.com/ru/post/897025/


All Articles