Skip to content
Permalink
Browse files

Merge pull request #49 from jglick/remoting-class-version-JENKINS-25272

[JENKINS-25272] Extend JENKINS-18403 workaround for newer remoting.jar
  • Loading branch information...
jglick committed Aug 7, 2015
2 parents 02ca060 + 0913aa1 commit c88577a3d56b0968eacb118bd3adb7ea35914a19
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/main/java/hudson/maven/AbstractMavenProcessFactory.java
@@ -46,6 +46,7 @@
import javax.annotation.CheckForNull;

import hudson.util.StreamCopyThread;
import java.net.SocketException;
import jenkins.model.Jenkins;
import jenkins.security.MasterToSlaveCallable;
import org.apache.tools.ant.Project;
@@ -277,15 +278,16 @@ public String call() throws IOException {
throw e;
}

Channel ch = Channels.forProcess("Channel to Maven " + Arrays.toString(cmds),
Computer.threadPoolForRemoting, new BufferedInputStream(con.in), new BufferedOutputStream(con.out),
listener.getLogger(), proc);
Channel ch;
try {
ch = Channels.forProcess("Channel to Maven " + Arrays.toString(cmds),
Computer.threadPoolForRemoting, new BufferedInputStream(con.in), new BufferedOutputStream(con.out),
listener.getLogger(), proc);
ch.call(new ConfigureOriginalJDK(originalJdk));
} catch (IOException x) {
if (originalJdk == null) { // so we only try this once
for (Throwable t = x; t != null; t = t.getCause()) {
if (t instanceof UnsupportedClassVersionError) {
if (t instanceof UnsupportedClassVersionError || t instanceof SocketException) {
listener.error("[JENKINS-18403] JDK 5 not supported to run Maven; retrying with slave Java and setting compile/test properties to point to " + jdk.getHome());
originalJdk = jdk;
jdk = launcher.getChannel().call(new FindJavaHome());

0 comments on commit c88577a

Please sign in to comment.
You can’t perform that action at this time.