title: Jenkins multibranch pipeline only for subfolder
body: <p>I have git monorepo with different apps. Currently I have single Jenkinsfile in root folder that contains pipeline for app alls. It is very time consuming to execute full pipeline for all apps when commit changed only one app.</p>
  
  <p>We use GitFlow-like approach to branching so Multibranch Pipeline jobs in Jenkins as perfect fit for our project.</p>
  
  <p>I'm looking for a way to have several jobs in Jenkins, each one will be triggered only when code of appropriate application was changed.</p>
  
  <p><strong>Perfect solution for me looks like this:</strong></p>
  
  <p>I have several Multibranch Pipeline jobs in Jenkins. Each one looks for changes only to given directory and subdirectories. Each one uses own Jenkinsfile. Jobs pull git every X minutes and if there are changes to appropriate directories in existing branches - initiates build; if there are new branches <strong>with changes to appropriate directories</strong>  - initiates build. </p>
  
  <p><strong>What stops me from this implementation</strong></p>
  
  <ol>
  <li><p>I'm missing a way to define commit to which folders must be ignored during scan execution by Multibranch pipeline. "Additional behaviour" for Multibranch pipeline doesn't have "Polling ignores commits to certain paths" option, while Pipeline or Freestyle jobs have. But I want to use Multibranch pipeline.</p></li>
  <li><p>Solution described <a href="https://stackoverflow.com/questions/44901004/how-to-only-build-one-directory-in-a-jenkins-multi-branch-pipeline-job">here</a> doesnt work for me because if there will be new branch with changes only to "project1" then whenever Multibranch pipeline for "project2" will be triggered it will discover this new branch anyway and build it. Means for every new branch each of my Multibranch pipelines will be executed at least once no matter if there was changes to appropriate code or not. </p></li>
  </ol>
  
  <p>Appreciate any help or suggestions how I can implement few Multibranch pipelines watching over same git repository but triggered only when appropriate pieces of code changed</p>