title: How do I obtain a fully resolved Model of a pom file?
body: <p>How do I obtain a fully resolved Model of a pom file?</p>
  
  <p>This is basically a rephrasing of <a href="https://stackoverflow.com/questions/7429799/how-can-i-programmaticaly-build-the-effective-model-of-a-pom-file">How can i programmaticaly build the effective model of a pom file?</a></p>
  
  <p>I'm building a maven plugin that performs some validation rules against a set of modules.
  Those modules' pom files are available but they're not part of the reactor when the plugin is executed.</p>
  
  <p>I can read a pom file and obtain the corresponding Model object using this method (removed exception handling for simplicity):</p>
  
  <pre><code>private Model pomToModel(String pathToPom) throws Exception {
      BufferedReader in = new BufferedReader(new FileReader(pathToPom));
      MavenXpp3Reader reader = new MavenXpp3Reader();
      Model model = reader.read(in);
      return model;
  }
  </code></pre>
  
  <p>And it works but the Model object has only the same information that the pom file has.</p>
  
  <p>How can I improve that method so that I can obtain a "fully resolved" Model object?
  By fully resolved, I mean: with all the transitive dependencies and everything else from the parent poms.</p>
  
  <p>Cheers!</p>