You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Niels Gylling <ng...@it-practice.dk> on 2007/01/08 10:02:36 UTC

Obtaining a plugin's dependencies

Java plugin question:

When writing a Java plugin, how do I obtain the currently executed 
plugins's dependency list?

I tried project.getBuild().getPlugins() but the plugin models here seems 
to be without dependencies.

Do I have to perform a lookup of the plugin as an artifact and get the 
dependencies from there  - or just hard code the additional dependencies 
in the plugin?

I need this because my plugin start a new java process with a classpath 
that I do now wish to copy to all modules referring to this plugin.

/Niels

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


Re: Obtaining a plugin's dependencies

Posted by Mark Hobson <ma...@gmail.com>.
On 09/01/07, Niels Gylling <ng...@it-practice.dk> wrote:
> Thanks Mark, it works.
> Now next step is figuring out how I missed it from the documentation...

Problems with finding answers in the Maven documentation?  Surely not.. ;)

Mark

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


Re: Obtaining a plugin's dependencies

Posted by Niels Gylling <ng...@it-practice.dk>.
Thanks Mark, it works.
Now next step is figuring out how I missed it from the documentation...

/Niels

Mark Hobson wrote:
> On 08/01/07, Niels Gylling <ng...@it-practice.dk> wrote:
>> That did not work, ${plugin.artifacts} og ${plugin.artifactMap} did
>> resolved when the plugin was executed - I had to use the 'brute force'
>> method of resolving the plugin artifact dependencies manually.
> 
> Have you got @requiresDependencyResolution on your mojo?  See:
> http://maven.apache.org/developers/mojo-api-specification.html
> 
> 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: Obtaining a plugin's dependencies

Posted by Mark Hobson <ma...@gmail.com>.
On 08/01/07, Niels Gylling <ng...@it-practice.dk> wrote:
> That did not work, ${plugin.artifacts} og ${plugin.artifactMap} did
> resolved when the plugin was executed - I had to use the 'brute force'
> method of resolving the plugin artifact dependencies manually.

Have you got @requiresDependencyResolution on your mojo?  See:
http://maven.apache.org/developers/mojo-api-specification.html

Mark

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


Re: Obtaining a plugin's dependencies

Posted by Niels Gylling <ng...@it-practice.dk>.
That did not work, ${plugin.artifacts} og ${plugin.artifactMap} did 
resolved when the plugin was executed - I had to use the 'brute force' 
method of resolving the plugin artifact dependencies manually.

Tom Huybrechts wrote:
>     /**
>      * @parameter expression="${plugin.artifacts}"
>      * @required
>      * @readonly
>      */
>     private List pluginArtifacts;
> 
> 
> On 1/8/07, Niels Gylling <ng...@it-practice.dk> wrote:
>> Java plugin question:
>>
>> When writing a Java plugin, how do I obtain the currently executed
>> plugins's dependency list?
>>
>> I tried project.getBuild().getPlugins() but the plugin models here seems
>> to be without dependencies.
>>
>> Do I have to perform a lookup of the plugin as an artifact and get the
>> dependencies from there  - or just hard code the additional dependencies
>> in the plugin?
>>
>> I need this because my plugin start a new java process with a classpath
>> that I do now wish to copy to all modules referring to this plugin.
>>
>> /Niels
>>
>> ---------------------------------------------------------------------
>> 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
> 
> 

/Niels

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


Re: Obtaining a plugin's dependencies

Posted by Tom Huybrechts <to...@gmail.com>.
	/**
	 * @parameter expression="${plugin.artifacts}"
	 * @required
	 * @readonly
	 */
	private List pluginArtifacts;


On 1/8/07, Niels Gylling <ng...@it-practice.dk> wrote:
> Java plugin question:
>
> When writing a Java plugin, how do I obtain the currently executed
> plugins's dependency list?
>
> I tried project.getBuild().getPlugins() but the plugin models here seems
> to be without dependencies.
>
> Do I have to perform a lookup of the plugin as an artifact and get the
> dependencies from there  - or just hard code the additional dependencies
> in the plugin?
>
> I need this because my plugin start a new java process with a classpath
> that I do now wish to copy to all modules referring to this plugin.
>
> /Niels
>
> ---------------------------------------------------------------------
> 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