mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-10 02:26:18 +00:00
[FIXED HUDSON-2394] Improved error handling when Maven fails to start correctly in the m2 project type.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15501 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
9f71682941
commit
481fd5ab2e
2 files changed
+35
-1
No files matched your search
@@ -49,6 +49,11 @@ import java.util.logging.Logger;
|
||||
public abstract class Proc {
|
||||
private Proc() {}
|
||||
|
||||
/**
|
||||
* Checks if the process is still alive.
|
||||
*/
|
||||
public abstract boolean isAlive() throws IOException, InterruptedException;
|
||||
|
||||
/**
|
||||
* Terminates the process.
|
||||
*
|
||||
@@ -176,6 +181,16 @@ public abstract class Proc {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAlive() throws IOException, InterruptedException {
|
||||
try {
|
||||
proc.exitValue();
|
||||
return false;
|
||||
} catch (IllegalThreadStateException e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void kill() throws InterruptedException, IOException {
|
||||
destroy();
|
||||
@@ -254,6 +269,11 @@ public abstract class Proc {
|
||||
throw new IOException2("Failed to join the process",e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAlive() throws IOException, InterruptedException {
|
||||
return !process.isDone();
|
||||
}
|
||||
}
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(Proc.class.getName());
|
||||
|
||||
Reference in new issue
Block a user