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.
source share