title: How to include a maven module outside of the project context?
body: <p>I'd like to have a module in some kind of global project directory, so that I can include that module in all other projects that use that common code.</p>
  
  <p>But how can I then tell a maven parent <code>pom</code> to include and compile this global shared module?
  The following does not work:</p>
  
  <pre><code>svn/MyGlobalProject/project-commons/pom.xml           //should be shared among different projects
  svn/MyProject/web-parent/trunk/pom.xml                //the parent pom used to build the application
  svn/MyProject/web-parent/trunk/project-domain/pom.xml //submodule 1
  svn/MyProject/web-parent/trunk/project-web/pom.xml    //submodule 2
  </code></pre>
  
  <p>parent pom.xml:</p>
  
  <pre><code>&lt;project&gt;
          &lt;groupId&gt;de.project&lt;/groupId&gt;
      &lt;artifactId&gt;project-parent&lt;/artifactId&gt;
      &lt;packaging&gt;pom&lt;/packaging&gt;
  
      &lt;modules&gt;
          &lt;module&gt;project-domain&lt;/module&gt;
          &lt;module&gt;project-web&lt;/module&gt;
          &lt;module&gt;../project-commons&lt;/module&gt; &lt;!-- Error --&gt;
      &lt;/modules&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p><code>mvn package</code> results in:</p>
  
  <pre><code>Child module trunk\project-commons of trunk\pom.xml does not exist
  </code></pre>