Reputation: 678
I have an issue launching my multi-modal application, the application looks like this :
Everything is configured well so that the parent knows the modules, and each module is related to its parent using pom.xml files.
Now when I want to run the whole application I have to go through each module and execute the command mvn jetty:run separately.
Is there any way I can do that simply by going to the Parent's folder and doing a single command?
Upvotes: 1
Views: 1351
Reputation: 31567
Solution without changing directory - from project root directory, but with command per jetty
mvn -pl Module1/ jetty:run
mvn -pl Module2/ jetty:run
Used option: -pl,--projects <arg>
Comma-delimited list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path.
pom.xml
- alternative versionmvn -f Module1/pom.xml jetty:run
mvn -f Module2/pom.xml jetty:run
Used option: -f,--file <arg>
Force the use of an alternate POM file (or directory with pom.xml).
In general module
is not a separete application, but part of application (libraries, commons etc). In this case one jetty:run
is required by project.
Upvotes: 2
Reputation: 1290
Are you working on a Linux / Unix shell based environment?
On the shell (in directory parent) you could try the following command:
find ./ -name pom.xml | grep -E "Module1|Module2" | xargs -n 1 -P 10 mvn jetty:run -f
Upvotes: 2