I have more git-repositories than are fun to manually handle. So I'd like to treat them as as a single repository sometimes, for example when trying to make sure that the tests of a leaf-dependency doesn't fail because we updated version of dependency upstream. Writing a script seems like a good idea.
So I try to change the version of all root-poms in each repository to something that isn't used, eg latest-SNAPSHOT (simple with versions:set). But when I'd in the usages of this project like to tell them to uses the lastest_SNAPSHOT version of the dependency I get into problem.
mvn version:set requires the old-version of the dependency to replace it with a new one. But that is not information I have in this context so I need to probe the pom.xml to get it.
Is there a simple way to simply ask something like this: mvn xxx:getVersion -DgroupId=nnn -DartifactId=mmm and then get 1.2.3 as answer?
Did I say I'm writing this script in bash as a total noob so it is really not the time to suggest parsing the result of mvn dependency:tree or something like that unless you provide the full script for it.