You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Joachim Van der Auwera <jo...@progs.be> on 2006/11/05 00:42:24 UTC

How to get path to artifact for a dependency in a plugin

I am writing a plugin where I need access to the jar file for a dependency.

I have tried looping the dependencies to find this (from 
MavenProject.getDependencies()), but the dependencies always seem to 
have null as their getSystemPath() value.

I have also tried checking the artifacts, but similarly, getFile() on 
the artifacts is also always null...

So, what is the proper way to find the path where the artifact can be found?

Thanks for the help,
Joachim

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


Re: How to get path to artifact for a dependency in a plugin

Posted by pjungwir <ma...@9stmaryrd.com>.
Hi Joachim,

Some methods on MavenProject are deliberately limited to what you see in the
pom, and others contain "computed" values. getDependencies() and
getDependencyArtifacts() are the former type. Probably you want
getArtifacts(). That will give you a Set of Artifact objects which should
have the information you want.

Regards,
Paul



Joachim Van der Auwera wrote:
> 
> I am writing a plugin where I need access to the jar file for a
> dependency.
> 
> I have tried looping the dependencies to find this (from 
> MavenProject.getDependencies()), but the dependencies always seem to 
> have null as their getSystemPath() value.
> 
> I have also tried checking the artifacts, but similarly, getFile() on 
> the artifacts is also always null...
> 
> So, what is the proper way to find the path where the artifact can be
> found?
> 
> Thanks for the help,
> Joachim
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-get-path-to-artifact-for-a-dependency-in-a-plugin-tf2579609s177.html#a7326788
Sent from the Maven - Users mailing list archive at Nabble.com.


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