提交 3bf4b46b 编写于 作者: K kohsuke

Improved the error detection of missing Maven configuration in the native m2 job.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11225 71c3de6d-444a-0410-be80-ed276b4c234a
上级 8819c269
...@@ -6,6 +6,7 @@ import hudson.FilePath.FileCallable; ...@@ -6,6 +6,7 @@ import hudson.FilePath.FileCallable;
import hudson.Launcher; import hudson.Launcher;
import hudson.Util; import hudson.Util;
import hudson.tasks.BuildWrapper; import hudson.tasks.BuildWrapper;
import hudson.tasks.Maven;
import hudson.tasks.Maven.MavenInstallation; import hudson.tasks.Maven.MavenInstallation;
import hudson.maven.MavenBuild.ProxyImpl2; import hudson.maven.MavenBuild.ProxyImpl2;
import hudson.maven.reporters.MavenFingerprinter; import hudson.maven.reporters.MavenFingerprinter;
...@@ -378,9 +379,15 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave ...@@ -378,9 +379,15 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave
private void parsePoms(BuildListener listener, PrintStream logger) throws IOException, InterruptedException { private void parsePoms(BuildListener listener, PrintStream logger) throws IOException, InterruptedException {
logger.println("Parsing POMs"); logger.println("Parsing POMs");
MavenInstallation mvn = project.getMaven();
if(mvn==null) {
logger.println("A Maven configuration needs to be associated with this project. Please reconfigure this project");
throw new AbortException();
}
List<PomInfo> poms; List<PomInfo> poms;
try { try {
poms = project.getModuleRoot().act(new PomParser(listener,project.getMaven(),project.getRootPOM(),project.getProfiles())); poms = project.getModuleRoot().act(new PomParser(listener, mvn,project.getRootPOM(),project.getProfiles()));
} catch (IOException e) { } catch (IOException e) {
if (e.getCause() instanceof AbortException) if (e.getCause() instanceof AbortException)
throw (AbortException) e.getCause(); throw (AbortException) e.getCause();
......
<!--
If necessary, ask the client to fetch update-center data file for us.
This allows us to avoid proxy related configuration on the server,
and instead piggy-back on user connection.
This file is pulled into the layout.jelly
-->
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<j:if test="${it.due or forcedUpdateCheck}">
<script>
updateCenter.postBackURL = "${rootURL}/updateCenter/postBack";
updateCenter.version = "${h.version}";
Behaviour.addLoadEvent(updateCenter.checkUpdates);
</script>
</j:if>
</j:jelly>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册