Skip to content

Commit

Permalink
JENKINS-34789 Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fbelzunc committed Oct 6, 2016
1 parent 40d36bf commit 970007d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/main/java/hudson/maven/AbstractMavenProject.java
Expand Up @@ -73,11 +73,11 @@ public boolean shouldTriggerBuild(AbstractBuild build,
AbstractProject<?,?> downstreamProject = getDownstreamProject();

boolean ignoreUnsuccessfulUpstreams = ignoreUnsuccessfulUpstreams(downstreamProject);

MavenModuleSetBuild mavenModuleSetBuild = null;
if (build instanceof MavenModuleSetBuild) {
mavenModuleSetBuild = (MavenModuleSetBuild)build;
}
MavenModuleSetBuild mavenModuleSetBuild = null;
if (build instanceof MavenModuleSetBuild) {
mavenModuleSetBuild = (MavenModuleSetBuild)build;
}

// if the downstream module depends on multiple modules,
// only trigger them when all the upstream dependencies are updated.
Expand All @@ -87,10 +87,10 @@ public boolean shouldTriggerBuild(AbstractBuild build,
if (areUpstreamsBuilding(downstreamProject, parent, listener)) {
return false;
}
// Check to see if is a release so we don't trigger the downstream project
else if (mavenModuleSetBuild != null && mavenModuleSetBuild.isARelease()) {
return false;
}
// Check to see if is a release so we don't trigger the downstream project
else if (mavenModuleSetBuild != null && mavenModuleSetBuild.isRelease()) {
return false;
}
// Check to see if any of its upstream dependencies are in this list of downstream projects.
else if (inDownstreamProjects(downstreamProject)) {
listener.getLogger().println("Not triggering " + ModelHyperlinkNote.encodeTo(downstreamProject) + " because it has dependencies in the downstream project list");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hudson/maven/MavenModuleSetBuild.java
Expand Up @@ -1446,7 +1446,7 @@ private String getRootPath(String prefix) {
* @since 2.12.2
* @return true if {@link MavenModuleSetBuild} is a release
*/
protected Boolean isARelease() {
protected Boolean isRelease() {
MavenModuleSet mavenModuleSet = this.getProject();
for (MavenModule mavenModule : mavenModuleSet.getModules()) {
if(mavenModule.getVersion().contains("-SNAPSHOT")) {
Expand Down

0 comments on commit 970007d

Please sign in to comment.