You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gary Kennedy <ga...@apnic.net> on 2015/04/01 00:01:49 UTC

Re: Plugin dependency resolution from plugin pom?

The setting used in the original plugin.xml for requiresDependencyResolutionString is runtime. I am not changing this when I am repackaging the plugin.

Also, it's the plugin dependencies that are not being resolved, not the project. (My test project is not using any dependencies)

Cheers,
Gary

On 27 Mar 2015, at 1:16 am, Martin Gainty <mg...@hotmail.com> wrote:

> plugin.xml
> requiresDependencyResolution
> 
> 
> 
>              String
> 
> 
> 
>            Flags this Mojo as requiring the dependencies in the specified class path to be resolved before it can
>            execute: compile, runtime, test,
>            compile+runtime (since Maven 3.0) or runtime+system (since Maven 3.0)
> 
> Default value is: runtime.
> https://maven.apache.org/ref/3.2.1/maven-plugin-api/plugin.html
> 
> does setting in plugin.xml <requiresDependencyResolutionString> not force dependencies to be resolved?
> 
> for your next run can you display debug info and error info so we can see determine the behaviour of the reactor?
> 
>> mvn -e -X <phase>
> 
> ?
> Martin 
> 
> 
>> From: gary@apnic.net
>> To: users@maven.apache.org
>> Subject: Plugin dependency resolution from plugin pom?
>> Date: Mon, 23 Mar 2015 22:41:39 +0000
>> 
>> I'm trying to patch a third-party plugin at the moment as a temporary workaround for a problem. (I don't want to get into details because it's not important)
>> 
>> So I currently have a 'patch project' that depends on the plugin, uses the maven-dependency-plugin to unpack the dependant plugin (without the replacement files), contains the replacement files, does some replacer magic on the extracted plugin.xml to fixup the version/etc, and then package it all.
>> 
>> This all works fine, in that the new project jar is a good content copy of the old plugin with all the changes needed.
>> 
>> However, when using the new plugin, several dependency errors occur. (i.e., the dependencies of the old plugin are not pulled in).
>> 
>> This confused me for a while because the maven plugin.xml file correctly lists all the dependencies. After a bit more playing around I worked out that this is because the plugin dependency resolution comes from the plugins pom.xml and NOT the plugin.xml file.
>> 
>> So my main question for the group is: How/Can I, at build time, add the dependency (and properties, if possible) section from the old plugin pom into my new plugin's artefact pom? (So not the project pom itself, but the one written to the maven repository)
>> 
>> And because I'm curious, does anyone know,
>>   a) why the plugin.xml contains the dependencies if they are not used?
>> or b) why the pom.xml is used instead of the plugin.xml to resolve dependencies? (I suspect aether + coding simplicity for this one)
>> 
>> Cheers,
>> Gary
>> 
>> 
>> ---------------------------------------------------------------------
>> 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