title: Jenkins Pipeline Build Trigger with git pull, how?
body: <p>I've got a maven, java project and I'm using git.
  I want to use jenkins for build + test + deploy (.war file) on tomcat server (on same device)</p>
  
  <p>My current question is about triggering the build with pushing changes into the git repository master. However it did work with jenkins freestyle project. There I could setup my git repository, so it detected any changes and run the build.</p>
  
  <p>But as far as I could make my research using a "pipeline" should be better to run the process with build + test + deploy. So I created a pipeline and also wrote a jenkinsfile.</p>
  
  <pre class="lang-java prettyprint-override"><code>pipeline {
      agent any
  
      stages {
          stage('Compile Stage') {
              steps {
                 withMaven(maven: 'maven_3_5_1'){
                 bat 'mvn clean compile'
                 }
              }
          }
          stage('Testing Stage') {
              steps {
                  withMaven(maven: 'maven_3_5_1'){
                      bat 'mvn test'
                  }
              }
          }
          stage('Deployment Stage (WAR)') {
              steps {
                  withMaven(maven: 'maven_3_5_1'){
                      bat 'mvn deploy'
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>The current problem is, that inside a pipeline project I could not find an option for setting up the git repository. Currently jenkins does not track any changes in git, when I push a change.</p>
  
  <p>What I've to do, so jenkins runs build when changes are detected in git (like in the freestyle project)?</p>
  
  <p>I thank you very much in advance.</p>