Thursday, November 15, 2012

Using Maven on multiple separate poms in one go

Ever found yourself in the need to execute Maven on a set of projects, all in the same dir, but they don't share a parent pom? You can of course run the Maven command once for each file. Or, you can use find:
$ find -maxdepth 2 -name pom.xml  -exec mvn eclipse:eclipse -f {} \;
Using find, you can get as crafty as you want in collecting the poms you need to process, and the exec call (see "man find") runs maven, giving each call the current file as the argument for -f.

No comments:

Post a Comment