Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-1295] Disable trigger downstream for maven jobs
Originally-Committed-As: c222acecaf0fe67d48711b9c298a85569b0a00fa
  • Loading branch information
Vlatombe committed Dec 2, 2012
1 parent 241b8a7 commit 612e43c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/hudson/maven/MavenModule.java
Expand Up @@ -488,7 +488,7 @@ protected void buildDependencyGraph(DependencyGraph graph) {
src = data.allModules.get(winner);
}

if(src!=null) {
if(src!=null && !src.getParent().isDisableTriggerDownstreamProjects()) {
DependencyGraph.Dependency dep = new MavenModuleDependency(nodeOf(src),nodeOf(this));
if (!dep.pointsItself())
graph.addDependency(dep);
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/hudson/maven/MavenModuleSet.java
Expand Up @@ -265,6 +265,12 @@ public class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,MavenMod
* @deprecated since 1.484 settings are provided by {@link #globalSettings}
*/
private String globalSettingConfigId;

/**
* Whether to participate in triggering downstream projects.
* @since 1.494
*/
private boolean disableTriggerDownstreamProjects;

/**
* used temporary during maven build to store file path
Expand Down Expand Up @@ -851,6 +857,14 @@ protected void buildDependencyGraph(DependencyGraph graph) {
prebuilders.buildDependencyGraph(this,graph);
postbuilders.buildDependencyGraph(this,graph);
}

public boolean isDisableTriggerDownstreamProjects() {
return disableTriggerDownstreamProjects;
}

public void setDisableTriggerDownstreamProjects(boolean disableTriggerDownstreamProjects) {
this.disableTriggerDownstreamProjects = disableTriggerDownstreamProjects;
}

public MavenModule getRootModule() {
if(rootModule==null) return null;
Expand Down Expand Up @@ -1119,6 +1133,7 @@ protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOExceptio
reporters.rebuild(req,json,MavenReporters.getConfigurableList());
publishers.rebuildHetero(req, json, Publisher.all(), "publisher");
buildWrappers.rebuild(req,json,BuildWrappers.getFor(this));
disableTriggerDownstreamProjects = req.hasParameter("maven.disableTriggerDownstreamProjects");

runPostStepsIfResult = Result.fromString(req.getParameter( "post-steps.runIfResult"));
prebuilders.rebuildHetero(req,json, Builder.all(), "prebuilder");
Expand Down
Expand Up @@ -88,6 +88,10 @@ THE SOFTWARE.
title="${%Disable automatic artifact archiving}"
help="/plugin/maven-plugin/archivingDisabled.html"
checked="${it.isArchivingDisabled()}" />
<f:optionalBlock name="maven.disableTriggerDownstreamProjects"
title="${%Disable triggering of downstream projects}"
help="/plugin/maven-plugin/downstreamDisabled.html"
checked="${it.isDisableTriggerDownstreamProjects()}" />
<f:optionalBlock name="maven.perModuleBuild" title="${%Build modules in parallel}" help="/plugin/maven-plugin/aggregator.html"
checked="${!it.aggregatorStyleBuild}" />
<f:optionalBlock name="maven.usePrivateRepository" title="${%Use private Maven repository}" help="/plugin/maven-plugin/private-repository.html"
Expand Down
Expand Up @@ -44,4 +44,5 @@ Add\ post-build\ step=Ajouter une \u00E9tape post-build
Add\ pre-build\ step=Ajouter une \u00E9tape pr\u00E9-build
Post-Build\ Run\ Criteria=Crit\u00E8re pour ex\u00E9cuter le post-build
Steps\ to\ run\ after\ mvn\ build=\u00C9tapes \u00E0 lancer apr\u00E8s le build maven
Steps\ to\ run\ before\ mvn\ build=\u00C9tapes \u00E0 lancer avant le build maven
Steps\ to\ run\ before\ mvn\ build=\u00C9tapes \u00E0 lancer avant le build maven
Disable\ triggering\ of\ downstream\ projects=D\u00e9sactive le lancement des projets en aval

0 comments on commit 612e43c

Please sign in to comment.