title: Jenkins fails to parse POM with variables
body: <p><strong>tl;dr:</strong> <code>mvn clean install</code> works as expected, but Jenkins is not able to resolve variables in child poms.</p>
  
  <p>We have a project with a main pom and multiple sub poms. It seems to fail in the sub pom with the variable <code>${project.version}</code> not being resolved (see the error message below and scroll to its end).</p>
  
  <p>Main pom:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;group&lt;/groupId&gt;
      &lt;artifactId&gt;artifact&lt;/artifactId&gt;
      &lt;version&gt;1.0.0.0-SNAPSHOT&lt;/version&gt;
      ...
  &lt;/project&gt;
  </code></pre>
  
  <p>Sub pom:</p>
  
  <pre><code>&lt;parent&gt;
      &lt;groupId&gt;group&lt;/groupId&gt;
      &lt;artifactId&gt;artifact&lt;/artifactId&gt;
      &lt;version&gt;${project.version}&lt;/version&gt;
      &lt;relativePath&gt;../pom.xml&lt;/relativePath&gt;
  &lt;/parent&gt;
  </code></pre>
  
  <p><code>mvn clean install</code> on the console works flawlessly: </p>
  
  <pre><code>[INFO] Installing /path/to/jenkins/workspace/Project/pom.xml to /path/to/.m2/repository/de/project/1.0.0.0-SNAPSHOT/project-1.0.0.0-SNAPSHOT.pom
  [INFO] ------------------------------------------------------------------------
  [INFO] Reactor Summary:
  [INFO]
  ...
  [INFO] PROJECT 1.0.0.0-SNAPSHOT - EAR project ........... SUCCESS [  5.038 s]
  [INFO] PROJECT 1.0.0.0-SNAPSHOT - Aggregator project ........ SUCCESS [  0.156 s]
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 01:03 min
  [INFO] Finished at: 2016-09-20T12:58:03+02:00
  [INFO] Final Memory: 104M/1088M
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>Jenkins fails to parse the pom and produces the following error:</p>
  
  <pre><code>Parsing POMs
  ERROR: Failed to parse POMs
  org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
  [FATAL] Non-resolvable parent POM: Failure to transfer my.package:project:pom:${project.version} from http://mynexus.com/content/groups/default was cached in the local repository, resolution will not be reattempted until the update interval of nexus-default has elapsed or updates are forced. Original error: Could not transfer artifact my.package:project:pom:${project.version} from/to nexus-default (http://mynexus.com/content/groups/default): Illegal character in path at index 78: http://mynexus.com/content/groups/default/my/package/project/${project.version}/panda-${project.version}.pom and 'parent.relativePath' points at wrong local POM @ line 26, column 10
  </code></pre>
  
  <p><strong>What has to be changed so that Jenkins can parse the pom file aswell?</strong></p>
  
  <p>The <a href="https://stackoverflow.com/questions/26858565/unable-to-resolve-project-version-in-child-pom-xml-from-parent-pom-xml">linked question</a> states that maven would not be able to parse the child's properties as they wouldn't exist. The maven logs above show that this is not the case.</p>
  
  <p>The information above is redacted. Typos are not the reason for this issue.</p>