Reputation: 4392
I have two projects as follows, in neighbouring directories on the filesystem:
I'd like to build project_b and for Maven to discover that project_a exists on the filesystem and thus build it rather than look in the local repo for its artifact.
I could build these within an aggregator and use the reactor to select project_b i.e.
mvn --projects project_b [goal]
However, this is problematic because
Is there a neat way I could get Maven to perform a recursive build that looks on the filesystem to find -SNAPSHOT dependency projects and builds them?
Upvotes: 4
Views: 3820
Reputation: 2038
I needed this a while back and made a simple recursive wrapper cli in nodejs. https://github.com/kenglxn/mvnr/blob/master/README.md
Install from npm with
sudo npm install -g mvnr
Then just pass any maven command to mvnr, and it will run that command on all mvn projects under the cwd.
Upvotes: 2
Reputation: 31795
You could play with Maven Reactor plugin, e.g. try mvn reactor:make -Dmake.folders=foo,bar
Upvotes: 1