Skip to content

Instantly share code, notes, and snippets.

@tszpinda
Last active October 19, 2015 10:50
Show Gist options
  • Save tszpinda/657c80b2d57ea4a786ad to your computer and use it in GitHub Desktop.
Save tszpinda/657c80b2d57ea4a786ad to your computer and use it in GitHub Desktop.
read pom.xml
def ant = new AntBuilder();
def scanner = ant.fileScanner {
fileset(dir:'.') {
include(name:"**/pom.xml")
exclude(name:"**/target/")
}
}
def count = 0;
for (f in scanner) {
count ++;
if(count == 1) {
println("found $f");
def root = new XmlSlurper().parse(f);
println root.version;
println root.artifactId;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment