maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Costin Caraivan <>
Subject Copy transitive dependencies
Date Tue, 07 Jul 2009 16:28:13 GMT


I have a plugin which needs to download & copy somewhere the transitive
dependencies of the project's dependencies (at least level 1, I'll see about
the rest).
So I have this: project -> dependencies -> transitive dependencies.
I extracted artifacts from the direct dependencies, so this part is ok.

For the rest of the mail, "artifact" is a direct dependency.
How can I access the transitive dependencies? I tried
artifact.getDependencyTrail() on the artifact - but this doesn't give me
what I need (I don't even understand exactly what getDependencyTrail() is
supposed to return :) ).

Next I tried creating MavenProjects from the artifact:
DefaultMavenProjectBuilder defaultMavenProjectBuilder = new
mavenProject = defaultMavenProjectBuilder.buildFromRepository(artifact,
remoteRepositories, localRepository)
I was thinking of using getDependencies() on the project, but this gives me
a nice NPE. How can I use DefaultMavenProjectBuilder?

I also looked around at maven-dependency-plugin & others but I'm having
problems understanding exactly the parts I need (plus the documentation
isn't that great...).

Any ideas?

Kind regard,
View this message in context:
Sent from the Maven Developers mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message