another script to print the version string from POM

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16491 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke 2009-03-23 19:18:50 +00:00
parent d0b1e4b384
commit 70cebd33af
1 changed files with 8 additions and 0 deletions

8
show-pom-version.rb Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/ruby
# parse POM from stdin and prints the version number
require "rexml/document"
require "rexml/xpath"
pom = REXML::Document.new $stdin
# if the POM doesn't define the version by itself, it's inherited from the parent
puts (pom.elements["/project/version"] || pom.elements["/project/parent/version"]).text