title: How to access local maven repository in plexus component?
body: <p>I am writing a custom DependencyAnalyzer which plugs into the <code>dependency:analyze</code> goal. The analyzer is a plexus component whose sole parameter is the <code>MavenProject</code> instance.</p>
  
  <p>My analyzer needs access to the local repository to be able to invoke the <code>DependencyTreeBuilder</code> (from <code>org.apache.maven.shared.dependency.tree</code>), which is the same component used by <code>dependency:tree</code> in verbose mode.</p>
  
  <p>I understand that in a mojo, I could use a parameter with the expression <code>"${localRepository}"</code> to get the required <code>ArtifactRepository</code> instance. However, I could not find a way to get the repository from the plexus component.</p>
  
  <p>I managed to add a dependency to the <code>ArtifactRepositoryFactory</code> plexus component, but have no idea what to pass to its <code>createArtifactRepository()</code> method.</p>
  
  <p>Is there any way to get the <code>ArtifactRepository</code>, or alternatively, a way to evaluate expressions from a plexus component?</p>
  
  <hr>
  
  <p>Note: this is similar to <a href="https://stackoverflow.com/q/1492000/7641">How to get access to Maven's dependency hierarchy within a plugin</a>, but the code given there applies to a mojo, whereas I need the code in a plexus component.</p>