I'm trying to perform a Maven build in a multi-module project structured like the below:
-> Project-Parent
-> Project-Utils
- pom.xml
-> Project-Service
- pom.xml
- pom.xml
Given what I've read on advanced Reactor options, I could possibly use the following command to build the Project-Utils project alone:
mvn -pl ./Project-Utils clean install
However, it seems that I would have to define Project-Utils in my parent POM as such:
<modules>
<module>Project-Utils</module>
</modules>
Is there any way I can use the --project option without having to define modules in the parent POM?
In the module POM make sure you set relativePath
This wil make sure maven will search for the parent pom in your repositiory.
To install the parent into the repository, navigate to the parent directory and execute
and then navigate to the directory of the module and execute
it should pick up the installed parent