Skip to content

Commit 70cebd3

Browse files
author
kohsuke
committed
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
1 parent d0b1e4b commit 70cebd3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

show-pom-version.rb

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

0 commit comments

Comments
 (0)