title: How to retrieve avaliable versions of a maven dependency programmatically?
body: <p>I want to find all available versions of a dependency in my project using a Mojo. I need this information to create a complete dependency tree where not only the transitive dependencies are included, but also all available versions and then their respective dependencies.</p>
  
  <p>The problem is that I can't simply download each individual metadata file since that would make the plugin too slow. What other ways are there to find all other versions through a Mojo and the Maven plugin API, and how do I achieve it?</p>
  
  <p>Example of tree I'm trying to generate.</p>
  
  <p><a href="https://i.stack.imgur.com/SgwSa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SgwSa.png" alt="enter image description here"></a></p>
  
  <p>If I only look at the components specified in the pom, I will miss out on the dependency a1.0 -> c1.1 and b1.0 -> d1.1.</p>
  
  <p>To clarify what information I am missing; the following graph shows what would appear if I where to simply use dependency:tree. </p>
  
  <p><a href="https://i.stack.imgur.com/QV29W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QV29W.png" alt="enter image description here"></a></p>