I am writing a Maven 2 plugin that should iterate over all the project dependencies and recursively across all the dependencies of these dependencies. So far, I have managed to solve only direct dependencies with this code:
for (Dependency dependency : this.project.getModel().getDependencies()) { Artifact artifact = this.artifactFactory.createArtifact( dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion(), dependency.getScope(), dependency.getType()); this.artifactResolver.resolve( artifact, this.remoteRepositories, this.localRepository); .... }
How can I do the same recursively to find dependency dependencies, etc.?
source share