-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins 1.565.3 running on Tomcat7/java7 (linux), maven-plugin 2.7, maven 3.1.0, build-JDK: jdk1.6.0_45
In our Jenkins project configurations we want to build projects automatically whenever a SNAPSHOT dependency has been built (stable or with test failures). But this doesn't work for builds that have test failures.
Example
- Project B is a downstream project of project A
- In section Build Triggers of project B option Build whenever a SNAPSHOT dependency is built is set.
- Project A is built with test failures (unstable).
- A new SNAPSHOT jar is built for project A
- Error: No schedule for project B is created (project B will not be build).
After a build from Project A with test failures and a new created SNAPSHOT jar a build schedule for project B should be created:
Online help for the option Build whenever a SNAPSHOT dependency is built:
If checked, Jenkins will parse the POMs of this project, and see if any of its snapshot dependencies are built on this Jenkins as well. If so, Jenkins will set up build dependency relationship so that whenever the dependency job is built and a new SNAPSHOT jar is created, Jenkins will schedule a build of this project.
Currently in our environment a schedule for Project B will be created only when the build from Project A succeeds (without any Test failures).
It seems that the behaviour is not a bug. Downstream projects are only scheduled if the current project is built successfully.
Looking at hudson.maven.AbstractMavenProject.java in Jenkins maven-plugin, this issue is almost resolved in the logic. There is a condition in shouldTriggerBuild() to return immediately if build result doesn't meet Result#SUCCESS.
In my opinion the condition should be configurable like post build actions.