Resolving the dependencies for an Artifact

2014-06-18 Thread William Ferguson
I asked on maven-users but didn't get any viable responses. So I'm hoping someone here can help. -- I have a Mojo that needs to work with Maven 3.0.* and 3.1+ In the Mojo I have an Artifact and I need to resolve it's dependencies. How can/should I do it? If I can resolve

Re: Resolving the dependencies for an Artifact

2014-06-19 Thread Robert Scholte
Hi William, most of the time it's not necessary to find a specific file like this, so I'm wondering what the usecase is. If you're hitting an issue, think of a plugin which might have the same issue and have a look at its code. In this case I'm thinking of the maven-dependency-plugin, espec

Re: Resolving the dependencies for an Artifact

2014-06-19 Thread Daniel Kulp
For Aries, I ended up doing: @Component private org.apache.maven.repository.RepositorySystem repository; private File resolve(String artifactDescriptor) { String[] s = artifactDescriptor.split(":"); String type = (s.length >= 4 ? s[3] : "jar"); Artifact arti

Re: Resolving the dependencies for an Artifact

2014-06-19 Thread William Ferguson
Hi Robert, Use case is within the android-maven-plugin we need to generate artefacts for AAR (Android archive) dependencies when building a project. When doing so we need to provide the dependencies of the AAR (not the project) into the generation tool. We can readily retrieve the deps for the AA

Re: Resolving the dependencies for an Artifact

2014-06-19 Thread William Ferguson
Hi Dan, if the ArtifactResolutionResult contains the deps for the Artifact in the request then that's exactly what I want. However I can't see that it does. What am I missing? NB the resolution also needs to be able to resolve Artifacts in the reactor. I'm pretty certain that @Component priv

RE: Resolving the dependencies for an Artifact

2014-06-19 Thread Martin Gainty
> Date: Fri, 20 Jun 2014 08:29:10 +1000 > Subject: Re: Resolving the dependencies for an Artifact > From: william.fergu...@xandar.com.au > To: dev@maven.apache.org > > Hi Robert, > > Use case is within the android-maven-plugin we need to generate artefacts &g

Re: Resolving the dependencies for an Artifact

2014-06-19 Thread Daniel Kulp
On Jun 19, 2014, at 6:36 PM, William Ferguson wrote: > Hi Dan, > > if the ArtifactResolutionResult contains the deps for the Artifact in the > request then that's exactly what I want. However I can't see that it does. > What am I missing? ArtifactResolutionResult.getArtifacts() is a list of

Re: Resolving the dependencies for an Artifact

2014-06-19 Thread William Ferguson
> > > ArtifactResolutionResult.getArtifacts() is a list of all the artifacts > that it resolved. > Yes, but aren't those the artifacts that matched the ArtifactResolutionRequest? They're not the dependencies of the target of an ArtifactResolutionRequest. William > > NB the resolution also nee

Re: Resolving the dependencies for an Artifact

2014-06-19 Thread William Ferguson
> > MG>If I understand a prioritised dependency shortcut of A->B then B->C > (instead of A->C)? > MG>put this on the Jason's wishlist for Maven 4.x! > MG>does anyone know if Maven has ability to reorder the dependency graph? > I hadn't thought about that. I could look into maven-dep-tree and see i

Re: Resolving the dependencies for an Artifact

2014-06-20 Thread Hervé BOUTEMY
Le vendredi 20 juin 2014 08:36:46 William Ferguson a écrit : > Hi Dan, > > if the ArtifactResolutionResult contains the deps for the Artifact in the > request then that's exactly what I want. However I can't see that it does. > What am I missing? > > NB the resolution also needs to be able to res

Re: Resolving the dependencies for an Artifact

2014-06-20 Thread William Ferguson
OK, so it will resolve from the reactor. But is the ArtifactResolutionResult going to contain the dependencies of the Artifact that I resolve? On Fri, Jun 20, 2014 at 6:46 PM, Hervé BOUTEMY wrote: > Le vendredi 20 juin 2014 08:36:46 William Ferguson a écrit : > > Hi Dan, > > > > if the Artifac

Re: Resolving the dependencies for an Artifact

2014-06-20 Thread Hervé BOUTEMY
3 hints: 1. read Dan's explanations /> If you set “setResolveTransitively(true)” then the/ /> ArtifactResolutionResponse would have all the deps available in it./ 2. try Dan's code: it's pretty straightforward 3. explain what you want to see more than this code (which set everything to let cod

Re: Resolving the dependencies for an Artifact

2014-07-02 Thread William Ferguson
Thanks Dan. I didn't appreciate at first the impact of setResolveTransitively(true). NB I needed to change request.setResolveRoot(false) to exclude the provided artifact. William On Fri, Jun 20, 2014 at 11:44 AM, Daniel Kulp wrote: > > On Jun 19, 2014, at 6:36 PM, William Ferguson < > william