title: Maven: property substitution not done for /project/version tag of pom?
body: <p><a href="http://maven.apache.org/pom.html#Properties" rel="noreferrer">http://maven.apache.org/pom.html#Properties</a> says property "values are accessible anywhere within a POM".</p>
  
  <p>Should this read "are accessible in <em>most</em> places within a POM"?</p>
  
  <p>I can specify the version of a dependency no problem like so:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;junit&lt;/groupId&gt;
      &lt;artifactId&gt;junit&lt;/artifactId&gt;
      &lt;version&gt;${junit.version}&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>But what about the version of the project itself like so:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" ...&gt;
  
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
      &lt;artifactId&gt;my-app&lt;/artifactId&gt;
      &lt;version&gt;${myversion}&lt;/version&gt;
  
      &lt;properties&gt;
          &lt;myversion&gt;8&lt;/myversion&gt;
      &lt;/properties&gt;
  
      &lt;modules&gt;
          &lt;module&gt;alpha&lt;/module&gt;
          &lt;module&gt;beta&lt;/module&gt;
      &lt;/modules&gt;
      ...
  </code></pre>
  
  <p>If I try this &lt;version> will not take the value 8. Here I've defined ${myversion} in the pom but the same seems to be the case if I specify -Dmyversion=8 on the command line.</p>
  
  <p>If one of the modules specifies its parent with a hardcoded version number like so:</p>
  
  <pre><code>&lt;parent&gt;
      &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
      &lt;artifactId&gt;my-app&lt;/artifactId&gt;
      &lt;version&gt;8&lt;/version&gt;
  &lt;/parent&gt;
  </code></pre>
  
  <p>When I try to build then when maven comes to look at the module's pom it will say it cannot find the given parent pom with version 8.</p>
  
  <p>However if I hardcode version in the parent to 8 as well, rather than using ${myversion}, then everything works fine.</p>
  
  <p>So it <em>seems</em> to me that property substitution does not happen for the /project/version tag of the parent pom.</p>
  
  <p>Is this the case or is there some other explanation for what I seem to be seeing?</p>
  
  <p>Regards,</p>
  
  <p>/George</p>