You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Meyer <mi...@bluewin.ch> on 2006/04/12 09:56:53 UTC

[m203] Get names of all transitive dependencies in a mojo

Hi,
how can I retrive the names of all dependencies including the transitive 
dependencies in a Java Plugin (Mojo)?
I took a look at the code of the eclipse plugin but the dependency part 
seemed a bit complicated for
"just" getting all transitive dependencies. And I'm not familier with 
the term "reactor" that made understanding the
code a bit awkward ;-)

michael

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


RE: [m203] Get names of all transitive dependencies in a mojo

Posted by Dave Syer <da...@hotmail.com>.
> Check out the dependency plugin.   It has all the code you need. 

Would someone be able to summarise what the code in dependency plugin is
doing.  It seems very complex (and would certainly be useful to others), but
I don't follow it very well.  It seems to be doing project.getArtifacts()
and then filtering that list.  I would assume that filtering is an exclusion
(so the list should start with more on it than I might be interested in),
but when I do this in a mojo.execute:

  getLog().info("Artifacts: "+project.getArtifacts());

I get an empty set (despite the project having multiple dependencies - e.g.
aven-plugin-api).  Is that right?
-- 
View this message in context: http://www.nabble.com/-m203--Get-names-of-all-transitive-dependencies-in-a-mojo-tf1436664.html#a5758608
Sent from the Maven - Users forum at Nabble.com.


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


Re: [m203] Get names of all transitive dependencies in a mojo

Posted by Edwin Punzalan <ep...@exist.com>.
You can use the project-info-reports' dependencies report to see them.  
I think just doing "mvn site" will generate the dependencies report 
along with the other reports.


Michael Meyer wrote:
> Hi,
> how can I retrive the names of all dependencies including the 
> transitive dependencies in a Java Plugin (Mojo)?
> I took a look at the code of the eclipse plugin but the dependency 
> part seemed a bit complicated for
> "just" getting all transitive dependencies. And I'm not familier with 
> the term "reactor" that made understanding the
> code a bit awkward ;-)
>
> michael
>
> ---------------------------------------------------------------------
> 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: [m203] Get names of all transitive dependencies in a mojo

Posted by Kristian Nordal <kr...@gmail.com>.
On 4/12/06, Michael Meyer <mi...@bluewin.ch> wrote:
>
> Hi,
> how can I retrive the names of all dependencies including the transitive
> dependencies in a Java Plugin (Mojo)?
> I took a look at the code of the eclipse plugin but the dependency part
> seemed a bit complicated for
> "just" getting all transitive dependencies. And I'm not familier with
> the term "reactor" that made understanding the
> code a bit awkward ;-)


Hi,

You can do something like this to get all dependencies:

    /**
     * @parameter expression="${project.artifacts}"
     * @required
     */
    private Set artifacts;

Then get the name from all the Artifact instances.

--
Cheers,
Kristian