Search code examples
mavenjenkinsjenkins-pipelinejenkins-plugins

Configure Maven project as Jenkins Multibranch Pipeline


How can I configure a Jenkins Multibranch Pipeline as Maven project?

For a Maven project in Jenkins I get the option.:

Build Triggers

Build whenever a SNAPSHOT dependency is built

Build whenever a SNAPSHOT dependency is built

But for a Jenkins Multibranch Pipeline I don't get that option.

How to get that option for a Jenkins Multibranch Pipeline?


Solution

  • I used the Jenkins Multibranch Pipeline with a Jenkinsfile. In the file I configured the following:

    triggers {
      upstream(upstreamProjects: "PROJECT_NAME_IN_JENKINS", threshold: hudson.model.Result.SUCCESS)
    }
    

    So the build is triggered everytime the dependant upstream project is build successfully.