Skip to content
Permalink
Browse files

Merge pull request #83 from jglick/deps

[JENKINS-19508] Eliminate some optional deps
  • Loading branch information
Cyrille Le Clerc
Cyrille Le Clerc committed Aug 24, 2017
2 parents 895db72 + dd87250 commit f12c104daa1464b8e759a50b1c2e5aaa441e1516
@@ -98,7 +98,7 @@
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-multibranch</artifactId>
<version>2.14</version>
<optional>true</optional>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
@@ -110,7 +110,6 @@
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>branch-api</artifactId>
<version>2.0.9</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
@@ -6,7 +6,6 @@
import hudson.model.Cause;
import hudson.model.CauseAction;
import hudson.model.Item;
import hudson.model.ParametersDefinitionProperty;
import hudson.model.Queue;
import hudson.model.TaskListener;
import hudson.model.listeners.RunListener;
@@ -15,23 +14,17 @@
import hudson.security.ACLContext;
import hudson.triggers.Trigger;
import hudson.triggers.TriggerDescriptor;
import jenkins.branch.MultiBranchProject;
import jenkins.model.Jenkins;
import jenkins.model.ParameterizedJobMixIn;
import jenkins.security.QueueItemAuthenticatorConfiguration;
import jenkins.triggers.Messages;
import org.acegisecurity.Authentication;
import org.acegisecurity.context.SecurityContext;
import org.acegisecurity.context.SecurityContextHolder;
import org.jenkinsci.plugins.pipeline.maven.GlobalPipelineMavenConfig;
import org.jenkinsci.plugins.pipeline.maven.trigger.WorkflowJobDependencyTrigger;
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject;

import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.logging.Level;
import java.util.logging.Logger;

@@ -124,9 +117,9 @@ protected WorkflowJobDependencyTrigger getWorkflowJobDependencyTrigger(@Nonnull
}
}

if (parameterizedJob.getParent() instanceof WorkflowMultiBranchProject) {
if (parameterizedJob.getParent() instanceof ComputedFolder) {
// search for the triggers of MultiBranch pipelines
WorkflowMultiBranchProject multiBranchProject = (WorkflowMultiBranchProject) parameterizedJob.getParent();
ComputedFolder<?> multiBranchProject = (ComputedFolder) parameterizedJob.getParent();
for (Trigger trigger : multiBranchProject.getTriggers().values()) {
if (trigger instanceof WorkflowJobDependencyTrigger) {
return (WorkflowJobDependencyTrigger) trigger;
@@ -135,7 +128,7 @@ protected WorkflowJobDependencyTrigger getWorkflowJobDependencyTrigger(@Nonnull

if (multiBranchProject.getParent() instanceof ComputedFolder) {
// search for the triggers of GitHubOrg folders / Bitbucket folders
ComputedFolder grandParent = (ComputedFolder) multiBranchProject.getParent();
ComputedFolder<?> grandParent = (ComputedFolder) multiBranchProject.getParent();
Map<TriggerDescriptor, Trigger<?>> grandParentTriggers = grandParent.getTriggers();
for (Trigger trigger : grandParentTriggers.values()) {
if (trigger instanceof WorkflowJobDependencyTrigger) {

0 comments on commit f12c104

Please sign in to comment.
You can’t perform that action at this time.