Add a strategy to filter which build of a multi-branch pipeline trigger downstream pipelines.
It's common to NOT want to trigger downstream pipelines when a PR is built.
The downstream pipeline trigger on snapshot changes could support strategies based on the following:
- Don't trigger downstream pipelines on PR builds or on feature branches but only on master branch and maintenance branches
- Hard to differentiate feature branches from maintenance branches
- If the artifact of a PR is published to a maven repo then it deserves to trigger downstream pipelines
- Don't trigger downstream pipelines if the generated SNAPSHOT artifact has not been uploaded to a Maven repository)
- we could detect it because the artifact.version continues to be a "1.2.3-SNAPSHOT" version, same as the artifact.basedVersion and is NOT a qualified snapshot ("1.2.3-20170822-1213"). See https://github.com/jenkinsci/pipeline-maven-plugin/commit/76c0d6a2c5b33074e3b76c09d342cb5bb02693af
There are pros and cons, we have to find the approach that is the most consistent with other approaches in Jenkins pipeline to differentiates the behavior between branches. Declarative Pipeline is probably the most mature feature on this topic.