You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Benjamin Bentmann <be...@udo.edu> on 2009/08/12 22:43:32 UTC

[DISCUSS] Add new mojo annotation @requiresDependencyCollection

Hi,

for Maven 3.x, I would like to discuss the introduction of a new mojo 
annotation

   @requiresDependencyCollection <required-scope>

As the name probably suggests, the intended effect is to resemble an 
invocation of the artifact collector, i.e. calculate the dependency tree 
  but don't try to resolve the artifact files.

Some use cases that motivate this are outlined in [0] or [1]. The aim is 
to better support those plugins that want to analyze the dependency 
tree, e.g. version checking, but usually run in very early build phases 
where attempts to resolve the artifact files would either deliver stale 
data from the repos or simply fail.

In more detail, I envision the following behavior of the core. For any 
combination of @requiresDependencyCollection and 
@requiresDependencyResolution that we encounter within a mojo or 
project, invoke the artifact collector, using the union of the scopes 
requested by the two annos as the filter. The resulting artifact set 
will be stored in MavenProject.getArtifacts(). The subset of these 
artifacts whose scope matches @requiresDependencyResolution will be 
passed to the artifact resolver to grab the file.

The MavenProject.get*ClasspathElements() methods would exclude/skip all 
project artifacts without a file. This is meant to match current 
behavior where a mojo without @requiresDependencyResolution can call 
get*ClasspathElements() and simply will get an empty/incomplete result.

WDYT?


Benjamin


[0] http://markmail.org/message/hqumgsdbntbcogh5
[1] http://jira.codehaus.org/browse/MRELEASE-388

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


Re: [DISCUSS] Add new mojo annotation @requiresDependencyCollection

Posted by Brett Porter <br...@apache.org>.
On 12/08/2009, at 4:43 PM, Benjamin Bentmann wrote:

> Hi,
>
> for Maven 3.x, I would like to discuss the introduction of a new  
> mojo annotation
>
>  @requiresDependencyCollection <required-scope>
>
> ...

> WDYT?


That sounds reasonable to me.

- Brett



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