title: Releasing multiple Maven artifacts when using nested Git submodules
body: <p>I have been searching for a while now and could not find any working solution or guide/tutorial for releasing Maven modules when using nested Git submodules.</p>
  
  <p>We have a complex structure of public and private projects that require a specific order to build successfully. Our goal is to perform a Maven release in order to tag and deploy <strong>multiple Maven artifacts</strong> in a single step.</p>
  
  <p>Here is the simplified Maven project/modules and Git repository structure:</p>
  
  <pre><code>parent-public:1.0.0:pom (descriptor only, no Maven modules, public Git repository)
    |  |
    |  |- public-module:1.0.0-SNAPSHOT:jar
    |     (Maven module, child of parent-public, Git submodule, public repository)
    |
    |- parent-private:1.0.0-SNAPSHOT:pom
      (Maven modules, Git submodule, private repository)
         |
         |- public-module:1.0.0-SNAPSHOT:jar
         |  (Maven module only, child of parent-public, Git submodule, public repository, released)
         |
         |- private-module:1.0.0-SNAPSHOT:war
            (Maven module, child of parent-private, released)
  </code></pre>
  
  <p>The current structure allows Maven to build and deploy projects/modules independently. </p>
  
  <p>When releasing <code>public-module</code> (from the <em>parent-public/parent-private/public-module</em> directory), the <code>maven-release-plugin</code> performs well (Git repository has been tagged and release artifact has been deployed).</p>
  
  <p>When releasing <code>parent-private</code>, the <code>maven-release-plugin</code> prepares and starts performing the release before failing during the <em>target</em> checkout (this problem is discussed <a href="https://stackoverflow.com/questions/6938142/how-to-get-maven-release-to-clone-git-submodules">here</a>, but solution is not working in my context and not enough reputation to comment).</p>
  
  <p>Here is the current <code>maven-release-plugin</code> configuration:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-release-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.3.2&lt;/version&gt;
      &lt;configuration&gt;
          &lt;tagNameFormat&gt;v@{project.version}&lt;/tagNameFormat&gt;
          &lt;commitByProject&gt;true&lt;/commitByProject&gt;
          &lt;pushChanges&gt;true&lt;/pushChanges&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>Is there a more elegant way to organize Maven modules and Git repositories in order to release multiple Maven artifacts? Alternatively, did someone find a solution to clone recursively Git submodules during checkout just before deploying artifacts?</p>