Skip to content

Commit

Permalink
another script to print the version string from POM
Browse files Browse the repository at this point in the history
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16491 71c3de6d-444a-0410-be80-ed276b4c234a
  • Loading branch information
kohsuke committed Mar 23, 2009
1 parent d0b1e4b commit 70cebd3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions show-pom-version.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 70cebd3

Please sign in to comment.