title: maven assembly throwing stackoverflowerror
body: <p>Hi denizens of stackoverflow,</p>
  
  <p>I am having an issue with maven, specifically with the assembly phase. I have a large multi-module legacy project that unfortunately has some circular references within its submodules. It has been retrofitted to build with maven, but to refactor the circular references out would take too long. </p>
  
  <p>The project builds fine by running mvn install, and even runs mvn package without issue, but fails when running mvn package assembly:assembly. Trying to run it with assembly:single gives me a build failure due to "Error creating assembly archive distrib: You must set at least one file".</p>
  
  <p>With assembly:assembly, it seems to be processing the same libraries over and over again, eventually throwing a stackoverflowerror. I'm guessing this means that the circular references in the modules is causing this, though since it compiles with no issues, I had hope it would survive assembly as well. </p>
  
  <p>Are there any other causes of this? </p>
  
  <p>The structure of the project is as follows: </p>
  
  <pre><code>Parent
   |_ Child1
   |_ Child2
   |_ dist-proj
  </code></pre>
  
  <p>The parent pom has the following sections:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.2.1&lt;/version&gt;
      &lt;configuration&gt;
          &lt;descriptors&gt;
              &lt;descriptor&gt;src/main/assembly/assembly-dependencies.xml&lt;/descriptor&gt;
          &lt;/descriptors&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  &lt;modules&gt;
      &lt;module&gt;Child1&lt;/module&gt;
      &lt;module&gt;Child2&lt;/module&gt;
      &lt;module&gt;dist-proj&lt;/module&gt;
  &lt;/modules&gt;
  </code></pre>
  
  <p>The dist-proj pom:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.2.1&lt;/version&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;dist-proj&lt;/id&gt;
              &lt;phase&gt;assembly&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;single&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                  &lt;descriptors&gt;
                      &lt;descriptor&gt;src/main/assembly/assembly-dependencies.xml&lt;/descriptor&gt;
                  &lt;/descriptors&gt;
              &lt;/configuration&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>And the assembly file:</p>
  
  <pre><code>&lt;moduleSets&gt;
      &lt;moduleSet&gt;
      &lt;useAllReactorProjects&gt;true&lt;/useAllReactorProjects&gt;
      &lt;includes&gt;
          &lt;include&gt;groupid:Child1&lt;/include&gt;
          &lt;include&gt;groupid:Child2&lt;/include&gt;
       &lt;/includes&gt;
            &lt;binaries&gt;
               &lt;outputDirectory&gt;${project.build.finalName}&lt;/outputDirectory&gt;
               &lt;unpack&gt;false&lt;/unpack&gt;
               &lt;dependencySets&gt;
                  &lt;dependencySet&gt;
                     &lt;includes/&gt;
                     &lt;scope&gt;compile&lt;/scope&gt;
                  &lt;/dependencySet&gt;
                  &lt;dependencySet&gt;
                     &lt;includes/&gt;
                     &lt;scope&gt;runtime&lt;/scope&gt;
                     &lt;useTransitiveFiltering&gt;true&lt;/useTransitiveFiltering&gt;
                  &lt;/dependencySet&gt;
               &lt;/dependencySets&gt;
         &lt;/binaries&gt;
      &lt;/moduleSet&gt;
  &lt;/moduleSets&gt;
  </code></pre>
  
  <p>Any help would be very much appreciated.</p>