improved AbortException so that it can record the error message. Necessary for plugins like nunit and cppunit as discussed in HUDSON-3427.

This should be in 1.298.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16904 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-04-07 16:01:36 +00:00
1 parent 50c410c9e1
commit 444aa1d2ec
6 files changed
+31 -62

No files matched your search

@@ -387,7 +387,8 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave
return null;
} catch (AbortException e) {
// error should have been already reported.
if(e.getMessage()!=null)
listener.error(e.getMessage());
return Result.FAILURE;
} catch (InterruptedIOException e) {
listener.error("Aborted");
@@ -413,11 +414,10 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave
private void parsePoms(BuildListener listener, PrintStream logger, EnvVars envVars) throws IOException, InterruptedException {
logger.println("Parsing POMs");
MavenInstallation mvn = project.getMaven();
if(mvn==null) {
logger.println("A Maven installation needs to be available for this project to be built.");
logger.println("Either your server has no Maven installations defined, or the requested Maven version does not exist.");
throw new AbortException();
}
if(mvn==null)
throw new AbortException("A Maven installation needs to be available for this project to be built.\n"+
"Either your server has no Maven installations defined, or the requested Maven version does not exist.");
mvn = mvn.forEnvironment(envVars).forNode(Computer.currentComputer().getNode());
List<PomInfo> poms;
@@ -717,10 +717,8 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave
if(!pom.exists() && parentLoc.exists())
pom = parentLoc;
if(!pom.exists()) {
logger.println(Messages.MavenModuleSetBuild_NoSuchFile(pom));
throw new AbortException();
}
if(!pom.exists())
throw new AbortException(Messages.MavenModuleSetBuild_NoSuchFile(pom));
if(versbose)
logger.println("Parsing "+pom);