title: Maven: dependency:tree gives wrong results if outputType is graph and project contains multiple modules
body: <p>My project structure looks like this:</p>
  
  <ol>
  <li><p>PARENT POM which holds external dependencies [located separately from the project]</p></li>
  <li><p>MAIN POM, which is a child of PARENT POM, it holds a set of child modules [it is located in root folder of the project]</p></li>
  <li><p>CHILD MODULES, each of them is a child of MAIN POM, [a set of folders inside the root folder]</p></li>
  </ol>
  
  <p>I want to create a dependency graph of my project. For this I want to print the dependency data with</p>
  
  <pre><code> mvn org.apache.maven.plugins:maven-dependency-plugin:2.4:tree
  </code></pre>
  
  <p>-DoutputFile=deps.tgf -DoutputType=tgf -DappendOutput=true</p>
  
  <p>and then open generated file with some editor.</p>
  
  <p>The problem is that my approach works as expected only for simple projects, formed by one POM. For my case it fails. </p>
  
  <p>simple </p>
  
  <blockquote>
    <p>mvn dependency:tree</p>
  </blockquote>
  
  <p>works as expected and shows all the dependencies, including the child modules. But when I try to create my dependency tree with <strong><code>outputFile=text</code></strong> parameter, as I have written above, - it fails. It fetches only the dependencies of the Pom, on which I run the command, i.e. MAIN POM in my case. The child modules are missing!</p>
  
  <p>Is there a way to fix it? 
  Indeed, it looks like a bug in Maven: <code>mvn dependency:tree</code> works OK, and <code>mvn dependency:tree -DoutputFile=text</code> produces logically wrong results.</p>
  
  <p>UPDATE</p>
  
  <p>I have found what happens. It just stores the dependencies file in the child projects! I.e. if I have <code>childProject</code> which is a module inside MAIN POM - Maven create <code>outputFile.txt</code> inside this project! And it does not aggregate the files. Not sure I can do something with this apart from writing a script.</p>