提交 7984e310 编写于 作者: K Kohsuke Kawaguchi

[FIXED HUDSON-8060] Slaves launched by JNLP fail to reprot their version numbers.

上级 14d17c55
...@@ -45,6 +45,9 @@ Upcoming changes</a> ...@@ -45,6 +45,9 @@ Upcoming changes</a>
<li class=bug> <li class=bug>
Fixed an <tt>AbstractMethodError</tt> in listing up executors. Fixed an <tt>AbstractMethodError</tt> in listing up executors.
(<a href="http://issues.hudson-ci.org/browse/HUDSON-8106">issue 8106</a>) (<a href="http://issues.hudson-ci.org/browse/HUDSON-8106">issue 8106</a>)
<li class=bug>
Slaves launched by JNLP fail to reprot their version numbers.
(<a href="http://issues.hudson-ci.org/browse/HUDSON-8060">issue 8060</a>)
</ul> </ul>
</div><!--=TRUNK-END=--> </div><!--=TRUNK-END=-->
......
...@@ -159,7 +159,6 @@ public class Launcher { ...@@ -159,7 +159,6 @@ public class Launcher {
} }
public static void main(String... args) throws Exception { public static void main(String... args) throws Exception {
computeVersion();
Launcher launcher = new Launcher(); Launcher launcher = new Launcher();
CmdLineParser parser = new CmdLineParser(launcher); CmdLineParser parser = new CmdLineParser(launcher);
try { try {
...@@ -439,7 +438,7 @@ public class Launcher { ...@@ -439,7 +438,7 @@ public class Launcher {
return File.pathSeparatorChar==';'; return File.pathSeparatorChar==';';
} }
private static void computeVersion() { private static String computeVersion() {
Properties props = new Properties(); Properties props = new Properties();
try { try {
InputStream is = Launcher.class.getResourceAsStream("hudson-version.properties"); InputStream is = Launcher.class.getResourceAsStream("hudson-version.properties");
...@@ -448,11 +447,11 @@ public class Launcher { ...@@ -448,11 +447,11 @@ public class Launcher {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
VERSION = props.getProperty("version", "?"); return props.getProperty("version", "?");
} }
/** /**
* Version number of Hudson this slave.jar is from. * Version number of Hudson this slave.jar is from.
*/ */
public static String VERSION = "?"; public static final String VERSION = computeVersion();
} }
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
*/ */
package hudson.remoting.jnlp; package hudson.remoting.jnlp;
import hudson.remoting.Launcher;
import org.kohsuke.args4j.Option; import org.kohsuke.args4j.Option;
import org.kohsuke.args4j.CmdLineParser; import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Argument; import org.kohsuke.args4j.Argument;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册