Last active
August 23, 2017 21:27
-
-
Save saidsef/a44bb1911740c54aa63e73fe4e496127 to your computer and use it in GitHub Desktop.
Groovy! - Read pom.xml File
This file contains hidden or 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
#!/usr/bin/env groovy | |
import java.util.* | |
import groovy.util.XmlParser | |
def pom = new File('pom.xml').getText('utf-8') | |
def doc = new XmlParser().parseText(pom) | |
def version = doc.version.text() | |
println(version) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment