Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-25216

Build Triggers: Option "Build whenever a SNAPSHOT dependency is built" does not work properly

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • maven-plugin
    • 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).

          [JENKINS-25216] Build Triggers: Option "Build whenever a SNAPSHOT dependency is built" does not work properly

          Alexander Wolff added a comment - - edited

          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.

          Alexander Wolff added a comment - - edited 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.

          You should change this issue from buildresult-trigger-plugin to maven-plugin.

          Alexander Wolff added a comment - You should change this issue from buildresult-trigger-plugin to maven-plugin.

          We got the same problem in our project and would love to see this improvement, too.

          Matthias Hannen added a comment - We got the same problem in our project and would love to see this improvement, too.

          Any update on this? We really need an option to allow triggering downstream builds even if builds are unstable...

          Ebrahim Moshaya added a comment - Any update on this? We really need an option to allow triggering downstream builds even if builds are unstable...

            Unassigned Unassigned
            mwerner Michael Werner
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: