2

I'm resolving transitive dependencies in my MOJO and wish to have them returned in order from the bottom of the dependency tree up. Is this possible using Maven2? Here's my code so far:

Set<?> dependencyArtifacts = project.createArtifacts(artifactFactory,
  null, null);
ArtifactResolutionResult result = resolver.resolveTransitively(
  dependencyArtifacts, project.getArtifact(), remoteRepositories, localRepository,
  artifactMetadataSource);
Set<?> artifacts = result.getArtifacts();

As you can see the ArtifactResolutionResult getArtifacts method doesn't guarantee a sort order given the use of Set.

Christopher Hunt
  • 2,071
  • 1
  • 16
  • 20
  • 1
    It doesn't look as though I can get dependencies returned in bottom-up-tree order, so I'm now just cycling through my dependencies and, for each dependency I obtain its transitive dependencies and process them. This is working for me although it'd be nice to understand how a bottom-up tree order could be achieved. – Christopher Hunt Sep 16 '10 at 01:06

0 Answers0