We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d0b1e4b commit 70cebd3Copy full SHA for 70cebd3
show-pom-version.rb
@@ -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