title: Maven inheritance and evaluation of properties
body: <p>Since system scope is said to be deprecated and dangerous, we use a local repository. The repository is in the parent folder and used by most of the submodules. Now including the repo gets messy. Providing the URL is sort of a hack.</p>
  
  <p>We tried <code>${project.parent.basedir}/repo</code> in the submodules, but this evaluates to nothing. We also tried to set it in the parent pom, ...</p>
  
  <pre><code>&lt;repository&gt;
    &lt;id&gt;project_repo&lt;/id&gt;
    &lt;url&gt;file://${project.basedir}/project_repo&lt;/url&gt;
  &lt;/repository&gt;
  </code></pre>
  
  <p>but maven decides to ship the url as given to the submodules which in turn evaluate the property. This lead us to the mess of just taking the relative parent dir, forcing the submodules to be subfolders of the parent pom:</p>
  
  <pre><code>&lt;url&gt;file://${project.basedir}/../project_repo&lt;/url&gt;
  </code></pre>
  
  <p>This is problem <a href="https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem">Y</a>. The question concerning X is, why does maven inherit before evaluation and how can I avoid this?</p>