cjo9900 commented on Bug JENKINS-14278

I have also seen this while trying to test other behaviour for the conditional buildstep plugin.

However in this case I do not see the exception as this is consumed by the conditional buildstep Runner.
however I do see the the following
"ERROR: Build aborted. No projects to trigger. Check your configuration!"

Looking at the code it points to the function at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.getProjectList(BuildTriggerConfig.java:132)
returning an empty list.

This is called as
List<AbstractProject> projectList = config.getProjectList(build.getProject().getParent(),env);

However when this is a Matrix project
build is a MatrixBuild, and get Project gets the MatrixConfiguration and the parent of that is the MatrixProject which implements the ItemGroup<MatrixConfiguration>

So when Items.fromNameList(context, projectNames.toString(), AbstractProject.class) is called in the context is the MatrixProject so tries to get the project from that.

public List<AbstractProject> getProjectList(ItemGroup context, EnvVars env)

Possible solution would be to do
build.getRootBuild().getProject().getParent()
which should give the topbuild item in the tree

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to