> > 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 if I can determine what is doing the optimisation (ie removing B->C) and provide another method that allows the optimisation to be switched off. But it's adding another method to the mdt DependencyResolver interface - I've already added one in the last month :-). It's likely to be the only consumer of the new method. And it feels a little clunky as I am still resolving deps for A and then walking the graph until I find B to get B's deps. I would much rather just resolve deps for Artifact B. But to do that I need to be able to convert Artifact B into MavenProject B. Surely there has to be a way of doing that. Someone? William > > > > William > > > > > > On Fri, Jun 20, 2014 at 4:44 AM, Robert Scholte <rfscho...@apache.org> > > wrote: > > > > > 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, especially > the > > > code for dependency:tree. > > > Or use the org.apache.maven.project.ProjectBuilder > > > > > > thanks, > > > Robert > > > > > > Op Thu, 19 Jun 2014 00:01:52 +0200 schreef William Ferguson < > > > william.fergu...@xandar.com.au>: > > > > > > 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 the Artifact to a MavenProject then I can use > > >> DependencyGraphBuilder (from maven-dependency-tree) to construct a > graph > > >> of > > >> the deps. But I'm struggling to make the Artifact to MavenProject > > >> conversion happen. > > >> > > >> I thought that If I could get a URL to the Artifact's POM file then I > > >> could > > >> use DefaultMavenRuntime (maven-runtime) to resolve the URL into a > > >> MavenProject. But > > >> > > >> 1. I can't work out how to get a URL to the artifact's POM file (it > > >> > > >> needs to handle both reactor artifacts and repo artifacts) > > >> 2. Even with a URL to the POM file, MavenRuntime#getProject) is > > >> > > >> returning null. > > >> > > >> Can someone please point me in the right direction? > > >> Am I even on the right path or is there a much more straight forward > way > > >> of > > >> getting the dependencies for the Artifact? > > >> -------------------------- > > >> > > >> William > > >> > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org > > > For additional commands, e-mail: dev-h...@maven.apache.org > > > > > > > >