提交 ca758ab7 编写于 作者: K kohsuke

made the aggregator style build configurable. the aggregator style is the default.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4492 71c3de6d-444a-0410-be80-ed276b4c234a
上级 974cb64b
......@@ -88,6 +88,13 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
*/
private String mavenOpts;
/**
* If true, the build will be aggregator style. False otherwise.
*
* @since 1.133
*/
private boolean aggregatorStyleBuild = true;
/**
* Reporters configured at {@link MavenModuleSet} level. Applies to all {@link MavenModule} builds.
*/
......@@ -176,6 +183,10 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
};
}
public boolean isAggregatorStyleBuild() {
return aggregatorStyleBuild;
}
/**
* List of active {@link MavenReporter}s that should be applied to all module builds.
*/
......@@ -392,6 +403,7 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
goals = Util.fixEmpty(req.getParameter("goals").trim());
mavenOpts = Util.fixEmpty(req.getParameter("mavenOpts").trim());
mavenName = req.getParameter("maven_version");
aggregatorStyleBuild = req.getParameter("maven.perModuleBuild")==null;
reporters.rebuild(req,MavenReporters.getConfigurableList(),"reporter");
}
......
......@@ -276,7 +276,7 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave
for (MavenModule m : modules.values())
m.updateNextBuildNumber(getNumber());
if(!aggregatorStyle) {
if(!project.isAggregatorStyleBuild()) {
// start the build
logger.println("Triggering "+project.getRootModule().getModuleName());
project.getRootModule().scheduleBuild();
......@@ -327,7 +327,7 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave
}
public void post(BuildListener listener) {
if(aggregatorStyle) {
if(project.isAggregatorStyleBuild()) {
// schedule downstream builds. for non aggregator style builds,
// this is done by each module
if(getResult().isBetterOrEqualTo(Result.SUCCESS)) {
......@@ -502,7 +502,4 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave
* Extra versbose debug switch.
*/
public static boolean debug = false;
private static boolean aggregatorStyle = Boolean.getBoolean("aggregatorStyle");
}
<!--
configurations in the "advanced" tab.
-->
<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" xmlns:p="/lib/hudson/project">
<f:optionalBlock name="maven.perModuleBuild" title="Build modules in parallel" help="/help/maven/aggregator.html"
checked="${!it.aggregatorStyleBuild}" />
</j:jelly>
\ No newline at end of file
......@@ -42,6 +42,7 @@
<f:section title="Advanced Project Options">
<f:advanced>
<p:config-quietPeriod />
<st:include page="configure-advanced.jelly" optional="true" />
</f:advanced>
</f:section>
......
<div>
<p>
If checked, Hudson will run individual module builds as separate builds. On a project
with a large number of modules, or on a project where modules take a long time to build,
setting this option to true may speed up the whole build, as different modules can be built
in parallel.
<p>
Otherwise, leave it unchecked and Hudson will build this maven project like you'd normally
do from command line.
<p>
When your build uses "aggregator-style" multi-module aware mojos, you'd have to leave this
option unchecked so that the mojo will have access to all your modules.
<p>
Historically, this has been the default mode of the native maven project up to Hudson 1.133,
so if your project was created before that, you might want to uncheck this.
</div>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册