maven - Execute command in different directories -


i have requirement need change pom version of projects , following steps involved:

  1. search projects pom having particular version "1".
  2. now navigate these projects directory 1 one , execute maven command update version 1 one.

so far have been able list of projects using following command:

find . -name "pom.xml" -print0 | xargs -0 grep -il '1'  

now need execute maven command 'mvn versions:update-parent' in directory of each of pom's found above.

can done in single command?

edit:

if yes how go it?

just tested this, seems work. run 'mvn clean' in directory of pom containing 1.8.6:

find . -name 'pom.xml' -print0 \   | xargs -0 grep -l '1.8.6' \   | xargs -i xx find . -path xx -execdir mvn clean \; 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -