You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Sebastien Brunot <sb...@ilog.fr> on 2006/11/10 16:28:46 UTC

Resolving project dependencies

Hi all,
 
how do you programmaticaly resolve the dependencies of a MavenProject
object ?
 
I've got a MavenProject object in my mojo (that i've created from an
Artifact object), and i now want to resolves its dependencies in ordre
to get them as artifacts using the getArtifactDependencies() method.
What previous steps are implied before calling the
getArtifactDependencies() method ?
 
Thanks for your help,
 
Sebastien

Re: Resolving project dependencies

Posted by Tom Huybrechts <to...@gmail.com>.
Your wish...

http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook




On 11/10/06, Wayne Fay <wa...@gmail.com> wrote:
> This is the kind of stuff that needs to land in a Maven Plugin
> Developers doc/wiki/etc somewhere...
>
> Wayne
>
> On 11/10/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> > Thanks for your help tom, I now have all the information I needed.
> >
> > Sebastien
> >
> > -----Original Message-----
> > From: Tom Huybrechts [mailto:tom.huybrechts@gmail.com]
> > Sent: Friday, November 10, 2006 5:26 PM
> > To: Maven Users List
> > Subject: Re: Resolving project dependencies
> >
> > This works for me:
> >
> > Artifact pomArtifact = this.factory.createArtifact( groupId, artifactId,
> > version, "", "pom" ); MavenProject pomProject =
> > mavenProjectBuilder.buildFromRepository(
> > pomArtifact, this.remoteRepos, this.local ); Set artifacts =
> > pomProject.createArtifacts( this.factory, null, null);
> > ScopeArtifactFilter filter = new
> > ScopeArtifactFilter(DefaultArtifact.SCOPE_RUNTIME);
> > ArtifactResolutionResult arr = resolver.resolveTransitively(artifacts,
> > pomArtifact, local, remoteRepos, source, filter); Set result =
> > arr.getArtifacts();
> >
> >
> > On 11/10/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> > > What I'm doing exactly is as following:
> > >
> > > 1) I create an Artifact object using groupId, artifactId and version
> > > provided in the plugin configuration (the type is always "pom")
> > > 2) Using this artifact, I create a MavenProject object (with the
> > > buildFromRepository(...) method of a MavenProjectBuilder instance)
> > > 3) At this step, I want that a call to getArtifacts or
> > > getDependenciesArtifact returns the list of dependencies (non
> > > transitive or transitive) => in fact, it does not: getArtifacts
> > > returns an empty set while getDependenciesArtifact returns null.
> > >
> > > I've discovered the createArtifacts method of MavenProject thanks to
> > > your code, and it seems to create the set of (non transitive)
> > > dependencies artifact I was looking for. But what about transitive
> > > dependencies ? Do I have to take each artifact in the set returned by
> > > createArtifacts and "resolve" it recursively to get the "transitive"
> > > set of dependencies ? If yes, which method do I use knowing that I
> > > have an Artifact object and I want its set of artifact dependencies ?
> > >
> > > Thanks for your help,
> > >
> > > Sebastien
> > >
> > > -----Original Message-----
> > > From: Mark Hobson [mailto:markhobson@gmail.com]
> > > Sent: Friday, November 10, 2006 4:53 PM
> > > To: Maven Users List
> > > Subject: Re: Resolving project dependencies
> > >
> > > On 10/11/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> > > > I'm not sure I undestand your question, but I want to get a list of
> > > > all the artifact that correspond to a dependency declared in the
> > > > MavenProject POM, with or without transitivity depending on a
> > > > parameter set in my plugin configuration. Without transitivity is
> > > > mandatory, with transitivity is optional.
> > >
> > > I believe that: project.getArtifacts() returns all the project's
> > > dependencies, including transitive ones; and
> > > project.getDependencyArtifacts() only returns the immediate
> > > dependencies declared in the project's pom.
> > >
> > > Although you say you're trying to resolve the dependencies of a
> > > dependency in a project?  As soon as you start traversing deeper than
> > > the first level of dependencies in the pom, you need to start
> > > resolving them yourself.  I've recently extracted code to do this into
> >
> > > a shared component that's currently sitting in JIRA, see:
> > >
> > > http://jira.codehaus.org/browse/MNG-2654
> > >
> > > Mark
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Resolving project dependencies

Posted by Sebastien Brunot <sb...@ilog.fr>.
Or in the javadoc (the closer from the code, the better) !!!

Sebastien 

-----Original Message-----
From: Wayne Fay [mailto:waynefay@gmail.com] 
Sent: Friday, November 10, 2006 5:45 PM
To: Maven Users List
Subject: Re: Resolving project dependencies

This is the kind of stuff that needs to land in a Maven Plugin
Developers doc/wiki/etc somewhere...

Wayne

On 11/10/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> Thanks for your help tom, I now have all the information I needed.
>
> Sebastien
>
> -----Original Message-----
> From: Tom Huybrechts [mailto:tom.huybrechts@gmail.com]
> Sent: Friday, November 10, 2006 5:26 PM
> To: Maven Users List
> Subject: Re: Resolving project dependencies
>
> This works for me:
>
> Artifact pomArtifact = this.factory.createArtifact( groupId, 
> artifactId, version, "", "pom" ); MavenProject pomProject = 
> mavenProjectBuilder.buildFromRepository(
> pomArtifact, this.remoteRepos, this.local ); Set artifacts = 
> pomProject.createArtifacts( this.factory, null, null); 
> ScopeArtifactFilter filter = new 
> ScopeArtifactFilter(DefaultArtifact.SCOPE_RUNTIME);
> ArtifactResolutionResult arr = resolver.resolveTransitively(artifacts,
> pomArtifact, local, remoteRepos, source, filter); Set result = 
> arr.getArtifacts();
>
>
> On 11/10/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> > What I'm doing exactly is as following:
> >
> > 1) I create an Artifact object using groupId, artifactId and version

> > provided in the plugin configuration (the type is always "pom")
> > 2) Using this artifact, I create a MavenProject object (with the
> > buildFromRepository(...) method of a MavenProjectBuilder instance)
> > 3) At this step, I want that a call to getArtifacts or 
> > getDependenciesArtifact returns the list of dependencies (non 
> > transitive or transitive) => in fact, it does not: getArtifacts 
> > returns an empty set while getDependenciesArtifact returns null.
> >
> > I've discovered the createArtifacts method of MavenProject thanks to

> > your code, and it seems to create the set of (non transitive) 
> > dependencies artifact I was looking for. But what about transitive 
> > dependencies ? Do I have to take each artifact in the set returned 
> > by createArtifacts and "resolve" it recursively to get the
"transitive"
> > set of dependencies ? If yes, which method do I use knowing that I 
> > have an Artifact object and I want its set of artifact dependencies
?
> >
> > Thanks for your help,
> >
> > Sebastien
> >
> > -----Original Message-----
> > From: Mark Hobson [mailto:markhobson@gmail.com]
> > Sent: Friday, November 10, 2006 4:53 PM
> > To: Maven Users List
> > Subject: Re: Resolving project dependencies
> >
> > On 10/11/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> > > I'm not sure I undestand your question, but I want to get a list 
> > > of all the artifact that correspond to a dependency declared in 
> > > the MavenProject POM, with or without transitivity depending on a 
> > > parameter set in my plugin configuration. Without transitivity is 
> > > mandatory, with transitivity is optional.
> >
> > I believe that: project.getArtifacts() returns all the project's 
> > dependencies, including transitive ones; and
> > project.getDependencyArtifacts() only returns the immediate 
> > dependencies declared in the project's pom.
> >
> > Although you say you're trying to resolve the dependencies of a 
> > dependency in a project?  As soon as you start traversing deeper 
> > than the first level of dependencies in the pom, you need to start 
> > resolving them yourself.  I've recently extracted code to do this 
> > into
>
> > a shared component that's currently sitting in JIRA, see:
> >
> > http://jira.codehaus.org/browse/MNG-2654
> >
> > Mark
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Resolving project dependencies

Posted by Wayne Fay <wa...@gmail.com>.
This is the kind of stuff that needs to land in a Maven Plugin
Developers doc/wiki/etc somewhere...

Wayne

On 11/10/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> Thanks for your help tom, I now have all the information I needed.
>
> Sebastien
>
> -----Original Message-----
> From: Tom Huybrechts [mailto:tom.huybrechts@gmail.com]
> Sent: Friday, November 10, 2006 5:26 PM
> To: Maven Users List
> Subject: Re: Resolving project dependencies
>
> This works for me:
>
> Artifact pomArtifact = this.factory.createArtifact( groupId, artifactId,
> version, "", "pom" ); MavenProject pomProject =
> mavenProjectBuilder.buildFromRepository(
> pomArtifact, this.remoteRepos, this.local ); Set artifacts =
> pomProject.createArtifacts( this.factory, null, null);
> ScopeArtifactFilter filter = new
> ScopeArtifactFilter(DefaultArtifact.SCOPE_RUNTIME);
> ArtifactResolutionResult arr = resolver.resolveTransitively(artifacts,
> pomArtifact, local, remoteRepos, source, filter); Set result =
> arr.getArtifacts();
>
>
> On 11/10/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> > What I'm doing exactly is as following:
> >
> > 1) I create an Artifact object using groupId, artifactId and version
> > provided in the plugin configuration (the type is always "pom")
> > 2) Using this artifact, I create a MavenProject object (with the
> > buildFromRepository(...) method of a MavenProjectBuilder instance)
> > 3) At this step, I want that a call to getArtifacts or
> > getDependenciesArtifact returns the list of dependencies (non
> > transitive or transitive) => in fact, it does not: getArtifacts
> > returns an empty set while getDependenciesArtifact returns null.
> >
> > I've discovered the createArtifacts method of MavenProject thanks to
> > your code, and it seems to create the set of (non transitive)
> > dependencies artifact I was looking for. But what about transitive
> > dependencies ? Do I have to take each artifact in the set returned by
> > createArtifacts and "resolve" it recursively to get the "transitive"
> > set of dependencies ? If yes, which method do I use knowing that I
> > have an Artifact object and I want its set of artifact dependencies ?
> >
> > Thanks for your help,
> >
> > Sebastien
> >
> > -----Original Message-----
> > From: Mark Hobson [mailto:markhobson@gmail.com]
> > Sent: Friday, November 10, 2006 4:53 PM
> > To: Maven Users List
> > Subject: Re: Resolving project dependencies
> >
> > On 10/11/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> > > I'm not sure I undestand your question, but I want to get a list of
> > > all the artifact that correspond to a dependency declared in the
> > > MavenProject POM, with or without transitivity depending on a
> > > parameter set in my plugin configuration. Without transitivity is
> > > mandatory, with transitivity is optional.
> >
> > I believe that: project.getArtifacts() returns all the project's
> > dependencies, including transitive ones; and
> > project.getDependencyArtifacts() only returns the immediate
> > dependencies declared in the project's pom.
> >
> > Although you say you're trying to resolve the dependencies of a
> > dependency in a project?  As soon as you start traversing deeper than
> > the first level of dependencies in the pom, you need to start
> > resolving them yourself.  I've recently extracted code to do this into
>
> > a shared component that's currently sitting in JIRA, see:
> >
> > http://jira.codehaus.org/browse/MNG-2654
> >
> > Mark
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Resolving project dependencies

Posted by Sebastien Brunot <sb...@ilog.fr>.
Thanks for your help tom, I now have all the information I needed.

Sebastien 

-----Original Message-----
From: Tom Huybrechts [mailto:tom.huybrechts@gmail.com] 
Sent: Friday, November 10, 2006 5:26 PM
To: Maven Users List
Subject: Re: Resolving project dependencies

This works for me:

Artifact pomArtifact = this.factory.createArtifact( groupId, artifactId,
version, "", "pom" ); MavenProject pomProject =
mavenProjectBuilder.buildFromRepository(
pomArtifact, this.remoteRepos, this.local ); Set artifacts =
pomProject.createArtifacts( this.factory, null, null);
ScopeArtifactFilter filter = new
ScopeArtifactFilter(DefaultArtifact.SCOPE_RUNTIME);
ArtifactResolutionResult arr = resolver.resolveTransitively(artifacts,
pomArtifact, local, remoteRepos, source, filter); Set result =
arr.getArtifacts();


On 11/10/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> What I'm doing exactly is as following:
>
> 1) I create an Artifact object using groupId, artifactId and version 
> provided in the plugin configuration (the type is always "pom")
> 2) Using this artifact, I create a MavenProject object (with the
> buildFromRepository(...) method of a MavenProjectBuilder instance)
> 3) At this step, I want that a call to getArtifacts or 
> getDependenciesArtifact returns the list of dependencies (non 
> transitive or transitive) => in fact, it does not: getArtifacts 
> returns an empty set while getDependenciesArtifact returns null.
>
> I've discovered the createArtifacts method of MavenProject thanks to 
> your code, and it seems to create the set of (non transitive) 
> dependencies artifact I was looking for. But what about transitive 
> dependencies ? Do I have to take each artifact in the set returned by 
> createArtifacts and "resolve" it recursively to get the "transitive" 
> set of dependencies ? If yes, which method do I use knowing that I 
> have an Artifact object and I want its set of artifact dependencies ?
>
> Thanks for your help,
>
> Sebastien
>
> -----Original Message-----
> From: Mark Hobson [mailto:markhobson@gmail.com]
> Sent: Friday, November 10, 2006 4:53 PM
> To: Maven Users List
> Subject: Re: Resolving project dependencies
>
> On 10/11/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> > I'm not sure I undestand your question, but I want to get a list of 
> > all the artifact that correspond to a dependency declared in the 
> > MavenProject POM, with or without transitivity depending on a 
> > parameter set in my plugin configuration. Without transitivity is 
> > mandatory, with transitivity is optional.
>
> I believe that: project.getArtifacts() returns all the project's 
> dependencies, including transitive ones; and
> project.getDependencyArtifacts() only returns the immediate 
> dependencies declared in the project's pom.
>
> Although you say you're trying to resolve the dependencies of a 
> dependency in a project?  As soon as you start traversing deeper than 
> the first level of dependencies in the pom, you need to start 
> resolving them yourself.  I've recently extracted code to do this into

> a shared component that's currently sitting in JIRA, see:
>
> http://jira.codehaus.org/browse/MNG-2654
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Resolving project dependencies

Posted by Tom Huybrechts <to...@gmail.com>.
This works for me:

Artifact pomArtifact = this.factory.createArtifact( groupId,
artifactId, version, "", "pom" );
MavenProject pomProject = mavenProjectBuilder.buildFromRepository(
pomArtifact, this.remoteRepos, this.local );
Set artifacts = pomProject.createArtifacts( this.factory, null, null);
ScopeArtifactFilter filter = new
ScopeArtifactFilter(DefaultArtifact.SCOPE_RUNTIME);
ArtifactResolutionResult arr = resolver.resolveTransitively(artifacts,
pomArtifact, local, remoteRepos, source, filter);
Set result = arr.getArtifacts();


On 11/10/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> What I'm doing exactly is as following:
>
> 1) I create an Artifact object using groupId, artifactId and version
> provided in the plugin configuration (the type is always "pom")
> 2) Using this artifact, I create a MavenProject object (with the
> buildFromRepository(...) method of a MavenProjectBuilder instance)
> 3) At this step, I want that a call to getArtifacts or
> getDependenciesArtifact returns the list of dependencies (non transitive
> or transitive) => in fact, it does not: getArtifacts returns an empty
> set while getDependenciesArtifact returns null.
>
> I've discovered the createArtifacts method of MavenProject thanks to
> your code, and it seems to create the set of (non transitive)
> dependencies artifact I was looking for. But what about transitive
> dependencies ? Do I have to take each artifact in the set returned by
> createArtifacts and "resolve" it recursively to get the "transitive" set
> of dependencies ? If yes, which method do I use knowing that I have an
> Artifact object and I want its set of artifact dependencies ?
>
> Thanks for your help,
>
> Sebastien
>
> -----Original Message-----
> From: Mark Hobson [mailto:markhobson@gmail.com]
> Sent: Friday, November 10, 2006 4:53 PM
> To: Maven Users List
> Subject: Re: Resolving project dependencies
>
> On 10/11/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> > I'm not sure I undestand your question, but I want to get a list of
> > all the artifact that correspond to a dependency declared in the
> > MavenProject POM, with or without transitivity depending on a
> > parameter set in my plugin configuration. Without transitivity is
> > mandatory, with transitivity is optional.
>
> I believe that: project.getArtifacts() returns all the project's
> dependencies, including transitive ones; and
> project.getDependencyArtifacts() only returns the immediate dependencies
> declared in the project's pom.
>
> Although you say you're trying to resolve the dependencies of a
> dependency in a project?  As soon as you start traversing deeper than
> the first level of dependencies in the pom, you need to start resolving
> them yourself.  I've recently extracted code to do this into a shared
> component that's currently sitting in JIRA, see:
>
> http://jira.codehaus.org/browse/MNG-2654
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Resolving project dependencies

Posted by Sebastien Brunot <sb...@ilog.fr>.
What I'm doing exactly is as following:

1) I create an Artifact object using groupId, artifactId and version
provided in the plugin configuration (the type is always "pom")
2) Using this artifact, I create a MavenProject object (with the
buildFromRepository(...) method of a MavenProjectBuilder instance)
3) At this step, I want that a call to getArtifacts or
getDependenciesArtifact returns the list of dependencies (non transitive
or transitive) => in fact, it does not: getArtifacts returns an empty
set while getDependenciesArtifact returns null.

I've discovered the createArtifacts method of MavenProject thanks to
your code, and it seems to create the set of (non transitive)
dependencies artifact I was looking for. But what about transitive
dependencies ? Do I have to take each artifact in the set returned by
createArtifacts and "resolve" it recursively to get the "transitive" set
of dependencies ? If yes, which method do I use knowing that I have an
Artifact object and I want its set of artifact dependencies ?

Thanks for your help,

Sebastien 

-----Original Message-----
From: Mark Hobson [mailto:markhobson@gmail.com] 
Sent: Friday, November 10, 2006 4:53 PM
To: Maven Users List
Subject: Re: Resolving project dependencies

On 10/11/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> I'm not sure I undestand your question, but I want to get a list of 
> all the artifact that correspond to a dependency declared in the 
> MavenProject POM, with or without transitivity depending on a 
> parameter set in my plugin configuration. Without transitivity is 
> mandatory, with transitivity is optional.

I believe that: project.getArtifacts() returns all the project's
dependencies, including transitive ones; and
project.getDependencyArtifacts() only returns the immediate dependencies
declared in the project's pom.

Although you say you're trying to resolve the dependencies of a
dependency in a project?  As soon as you start traversing deeper than
the first level of dependencies in the pom, you need to start resolving
them yourself.  I've recently extracted code to do this into a shared
component that's currently sitting in JIRA, see:

http://jira.codehaus.org/browse/MNG-2654

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Resolving project dependencies

Posted by Mark Hobson <ma...@gmail.com>.
On 10/11/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> I'm not sure I undestand your question, but I want to get a list of all
> the artifact that correspond to a dependency declared in the
> MavenProject POM, with or without transitivity depending on a parameter
> set in my plugin configuration. Without transitivity is mandatory, with
> transitivity is optional.

I believe that: project.getArtifacts() returns all the project's
dependencies, including transitive ones; and
project.getDependencyArtifacts() only returns the immediate
dependencies declared in the project's pom.

Although you say you're trying to resolve the dependencies of a
dependency in a project?  As soon as you start traversing deeper than
the first level of dependencies in the pom, you need to start
resolving them yourself.  I've recently extracted code to do this into
a shared component that's currently sitting in JIRA, see:

http://jira.codehaus.org/browse/MNG-2654

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Resolving project dependencies

Posted by Sebastien Brunot <sb...@ilog.fr>.
I'm not sure I undestand your question, but I want to get a list of all
the artifact that correspond to a dependency declared in the
MavenProject POM, with or without transitivity depending on a parameter
set in my plugin configuration. Without transitivity is mandatory, with
transitivity is optional.

Sebastien 

-----Original Message-----
From: Mark Hobson [mailto:markhobson@gmail.com] 
Sent: Friday, November 10, 2006 4:38 PM
To: Maven Users List
Subject: Re: Resolving project dependencies

On 10/11/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> how do you programmaticaly resolve the dependencies of a MavenProject 
> object ?

Are you trying to resolve: the project's declared dependencies; all the
project's transitive dependencies; or traverse the project's dependency
tree?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Resolving project dependencies

Posted by Mark Hobson <ma...@gmail.com>.
On 10/11/06, Sebastien Brunot <sb...@ilog.fr> wrote:
> how do you programmaticaly resolve the dependencies of a MavenProject
> object ?

Are you trying to resolve: the project's declared dependencies; all
the project's transitive dependencies; or traverse the project's
dependency tree?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org