views:

37

answers:

0

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.