On Thu, Nov 18, 2010 at 7:17 AM, Lindsay Smith <[email protected]> wrote: > Hi, > > > > I have a need to be able to download all the dependencies from a pom, even if > there are multiple versions of the same dependency in the pom. The use case > is that I'm hoping to use maven to create p2 repositories, and so these > repositories can easily contain multiple versions of a bundle. > > > > I understand that maven's dependency resolution system culls multiple > versions out, because its taking the view that the dependencies form a > classpath. I expect to have to write a plugin to perform essentially what > the dependency:copy-dependencies goal does, except that it needs to read the > raw list of dependencies rather than the resolved list. > > > > What's the correct way to achieve this in a plugin? The MavenProject type > contains the resolved list of dependencies, if I use the MavenModel type will > this give me access to the raw list? If so, will I also have to manually > process any inherited pom dependencies if I wanted to? > > > > Of course if there is an existing way to achieve this that would be even > better. All help appreciated.
If you are using p2, why aren't you using Eclipse code - there should be something to do this already. This is probably the reverse of https://bugs.eclipse.org/bugs/show_bug.cgi?id=283745 You have a couple of options. Have a look at Aether https://docs.sonatype.org/display/AETHER/Home This may be all you need to trawl the repository for the bits you want. You may be able to get DefaultArtifactResolver (org.apache.maven.artifact.resolver.DefaultArtifactResolver.java from org.apache.maven:maven-artifact-manager:*) to do what you want, or at least look at the code to obtain the meta data and do the resolution yourself. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
