I have a parent POM in a Maven project, with this structure:
parent
|
---------------
| |
child1 child2
I want to install the POM of the "parent" in the local REPO to allow child1 take some changes that I did in the dependencyManagement, but I cannot do a regular "clean install" because "child2" is broken and will not build.
Which is the proper way to do this with maven (other than going to the parent pom and commenting the "child2" module).
Use the '-N' option in the mvn command.
From
mvn -h
:While Guillaume is indeed right and that is the correct option, I would personally recommend keeping your parent as a separate module.
I find the best approach for inheritance to be as follows:
This way you can always install the parent only, with
mvn clean install
without extra options.You can also have the parent outside the aggregator so you can re-use it between more projects.
There are numerous benefits to keeping the parent and the aggregator as two separate things. But in the end, you choose what's best for your project/environment.