title: Maven build fails ONLY when run with jenkins
body: <p>I have a Java project that is committed to GitHub. The project consists of 3 modules. I have configured the Jenkins Workflow Multibranch Pipeline plugin to build the 3 modules.</p>
  
  <pre><code>node {
     // Mark the code checkout 'stage'....
    // stage 'Checkout'
  
     // Get some code from a GitHub repository
     git url: 'git@github.com:me/myproject.git', credentialsId: '###'
  
     // Get the maven tool.
     // ** NOTE: This 'M3' maven tool must be configured
     // **       in the global configuration.
     def mvnHome = tool 'M3'
  
     stage 'Build module 1'
     sh "${mvnHome}/bin/mvn -f module-1/ clean install"
  
     stage 'Build module 2'
     sh "${mvnHome}/bin/mvn -f module-2/ clean install"
  
     stage 'Build module 3'
     sh "${mvnHome}/bin/mvn -f module-3/ clean install"
  }
  </code></pre>
  
  <p>Maven builds the first 2 modules with no problem. But on the third module I get the following error:</p>
  
  <pre><code> Compilation failure
  /var/lib/jenkins/workspace/.../MyClass.java:[136,44] cannot find symbol
    symbol:   method setStore(java.util.UUID,java.util.UUID,java.util.Date,int)
    location: variable _storeService of type com.my.module3.interfaces.StoreService
  </code></pre>
  
  <p>I have red that there may be a problem with the version of <code>maven-compiler-plugin</code> so I updated it to the latest <code>3.5.1</code> version, but it did not help. </p>
  
  <p>These are the maven plugins that I use in all 3 of the modules: </p>
  
  <pre><code>    &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.5.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.4.3&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;shade&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;finalName&gt;module3-${project.version}&lt;/finalName&gt;
                          &lt;artifactSet&gt;
                              &lt;includes&gt;
                                  &lt;include&gt;*:*&lt;/include&gt;
                              &lt;/includes&gt;
                          &lt;/artifactSet&gt;
                          &lt;filters&gt;
                              &lt;filter&gt;
                                  &lt;artifact&gt;*:*&lt;/artifact&gt;
                                  &lt;excludes&gt;
                                      &lt;exclude&gt;META-INF/*.SF&lt;/exclude&gt;
                                      &lt;exclude&gt;META-INF/*.DSA&lt;/exclude&gt;
                                      &lt;exclude&gt;META-INF/*.RSA&lt;/exclude&gt;
                                  &lt;/excludes&gt;
                              &lt;/filter&gt;
                          &lt;/filters&gt;
                          &lt;transformers&gt;
                              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"&gt;
                                  &lt;manifestEntries&gt;
                                      &lt;Main-Class&gt;com.my.module3.App&lt;/Main-Class&gt;
                                      &lt;Implementation-Title&gt;${project.name}&lt;/Implementation-Title&gt;
                                      &lt;Implementation-Version&gt;${project.version}&lt;/Implementation-Version&gt;
                                      &lt;Implementation-Vendor-Id&gt;${project.groupId}&lt;/Implementation-Vendor-Id&gt;
                                      &lt;Implementation-Vendor&gt;${project.organization.name}&lt;/Implementation-Vendor&gt;
                                  &lt;/manifestEntries&gt;
                              &lt;/transformer&gt;
                          &lt;/transformers&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  </code></pre>
  
  <p>When I build the module in IntelliJ there are no errors. I even pulled the repository in a new folder and used the <code>mvn clean install</code> command for the module3 and it finishes without a problem. </p>
  
  <p>I have no idea where the problem is. It does not seem that there is something wrong with my code, as it works correctly (I have debugged it). Any help or suggestions would be greatly appreciated. </p>