Created
July 1, 2016 20:26
-
-
Save jgeorgeson/29a1304af74f4716c2bf804c4f5cc7ca to your computer and use it in GitHub Desktop.
Read properties from Maven pom.xml with Groover
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def inputFile = new File("pom.xml") | |
if(!inputFile.exists()) { | |
println "Could not find 'pom.xml' file." | |
} else { | |
def project = new XmlSlurper(false,true) | |
.parseText(inputFile.text) | |
.declareNamespace('':'http://maven.apache.org/POM/4.0.0') | |
def p2path = project.properties.'p2.repoPath'.text() | |
def p2ver = project.properties.'p2.repoVersion'.text() | |
println "P2 Repo Path '" + p2path + "'" | |
println "P2 Repo Version '" + p2ver + "'" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment