提交 30025bbf 编写于 作者: A abayer

[FIXED HUDSON-4624] Fixed in 1.329 - checks to be sure there's been a previous...

[FIXED HUDSON-4624] Fixed in 1.329 - checks to be sure there's been a previous build before we try to get the changeset for a module

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@22535 71c3de6d-444a-0410-be80-ed276b4c234a
上级 8a34a63e
......@@ -427,10 +427,11 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
if (!MavenModuleSetBuild.this.getChangeSet().isEmptySet()
&& project.isIncrementalBuild()) {
// If there are changes for this module, add it.
if ((!getChangeSetFor(m).isEmpty())
// If the last actually-built build of this module wasn't a success,
// add it - i.e., rebuild anything that failed/was unstable in the past.
|| (mb.getPreviousBuiltBuild().getResult().isWorseThan(Result.SUCCESS))) {
// Also add it if we've never seen this module before,
// or if the previous build of this module failed or was unstable.
if ((mb.getPreviousBuiltBuild() == null) ||
(!getChangeSetFor(m).isEmpty())
|| (mb.getPreviousBuiltBuild().getResult().isWorseThan(Result.SUCCESS))) {
changedModules.add(m.getModuleName().toString());
}
}
......
......@@ -65,6 +65,22 @@ public class MavenMultiModuleTest extends HudsonTestCase {
}
/**
* NPE in {@code getChangeSetFor(m)} in {@link MavenModuleSetBuild} when incremental build is
* enabled and a new module is added.
*/
public void testNewModMultiModMaven() throws Exception {
configureDefaultMaven("apache-maven-2.2.1");
MavenModuleSet m = createMavenProject();
m.getReporters().add(new TestReporter());
m.setScm(new ExtractResourceWithChangesSCM(getClass().getResource("maven-multimod.zip"),
getClass().getResource("maven-multimod-changes.zip")));
m.setIncrementalBuild(true);
assertBuildStatusSuccess(m.scheduleBuild2(0).get());
}
/**
* When "-N' or "--non-recursive" show up in the goals, any child modules should be ignored.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册