From 7984e31026a05a2585a149bc6ad55158e0ea6a6b Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Thu, 2 Dec 2010 11:20:46 -0500 Subject: [PATCH] [FIXED HUDSON-8060] Slaves launched by JNLP fail to reprot their version numbers. --- changelog.html | 3 +++ remoting/src/main/java/hudson/remoting/Launcher.java | 7 +++---- remoting/src/main/java/hudson/remoting/jnlp/Main.java | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/changelog.html b/changelog.html index 8799b040db..a428ba597d 100644 --- a/changelog.html +++ b/changelog.html @@ -45,6 +45,9 @@ Upcoming changes
  • Fixed an AbstractMethodError in listing up executors. (issue 8106) +
  • + Slaves launched by JNLP fail to reprot their version numbers. + (issue 8060) diff --git a/remoting/src/main/java/hudson/remoting/Launcher.java b/remoting/src/main/java/hudson/remoting/Launcher.java index 57658594c5..9cddcdc336 100644 --- a/remoting/src/main/java/hudson/remoting/Launcher.java +++ b/remoting/src/main/java/hudson/remoting/Launcher.java @@ -159,7 +159,6 @@ public class Launcher { } public static void main(String... args) throws Exception { - computeVersion(); Launcher launcher = new Launcher(); CmdLineParser parser = new CmdLineParser(launcher); try { @@ -439,7 +438,7 @@ public class Launcher { return File.pathSeparatorChar==';'; } - private static void computeVersion() { + private static String computeVersion() { Properties props = new Properties(); try { InputStream is = Launcher.class.getResourceAsStream("hudson-version.properties"); @@ -448,11 +447,11 @@ public class Launcher { } catch (IOException e) { e.printStackTrace(); } - VERSION = props.getProperty("version", "?"); + return props.getProperty("version", "?"); } /** * Version number of Hudson this slave.jar is from. */ - public static String VERSION = "?"; + public static final String VERSION = computeVersion(); } diff --git a/remoting/src/main/java/hudson/remoting/jnlp/Main.java b/remoting/src/main/java/hudson/remoting/jnlp/Main.java index b80638f8e0..18cc59f62c 100644 --- a/remoting/src/main/java/hudson/remoting/jnlp/Main.java +++ b/remoting/src/main/java/hudson/remoting/jnlp/Main.java @@ -23,6 +23,7 @@ */ package hudson.remoting.jnlp; +import hudson.remoting.Launcher; import org.kohsuke.args4j.Option; import org.kohsuke.args4j.CmdLineParser; import org.kohsuke.args4j.Argument; -- GitLab