Skip to content

Instantly share code, notes, and snippets.

@saidsef
Last active August 23, 2017 21:27
Show Gist options
  • Save saidsef/a44bb1911740c54aa63e73fe4e496127 to your computer and use it in GitHub Desktop.
Save saidsef/a44bb1911740c54aa63e73fe4e496127 to your computer and use it in GitHub Desktop.
Groovy! - Read pom.xml File
#!/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