I have aggregation where I link a parent Pom using the <modules>
element, and then I have the <parent>
specified in each child pom.
Is there a way I can build only a subset of the child modules from the parent pom... i.e.
cd parent-dir
mvn install subproj1 subproj2
Maven will start building the project. We give maven two goals, first to clean the target directory (clean) and then package the project build output as jar (package). Packaged jar is available in consumerBanking\target folder as consumerBanking-1.0-SNAPSHOT.
Yes you can use Maven Profiles to manage this. Obviously you can tweak this approach to suit your needs however works best.
A multi-module project is built from an aggregator POM that manages a group of submodules. In most cases, the aggregator is located in the project's root directory and must have packaging of type pom. The submodules are regular Maven projects, and they can be built separately or through the aggregator POM.
This POM is the common parent of all of the Maven components in the Apache Maven project. Most of its contents are pinning down version numbers of plugins. It does provide minimal dependencyManagement for plexus-component and plugin-tools annotations.
You can run Maven like this: mvn install -pl subproj1,subproj2
PS: another good Maven command to try: mvn -?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With