You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Mark Hobson <ma...@gmail.com> on 2008/07/22 14:41:09 UTC

Re: Project.getArtifacts Does Not Return Provided Artifacts

2007/12/31 Brian E. Fox <br...@reply.infinity.nu>:
> Not specifying a phase is the same IIRC as not specifying
> @requiresDep....
>
> When you do this, the results are indeterminate (you get whatever has
> already been resolved by previous plugins)

Just encountered this missing provided-scope artifact problem myself.
If the above is true then this conflicts with the Mojo API
documentation:

http://maven.apache.org/developers/mojo-api-specification.html

Under requiresDependencyResolution, "If this annotation is present but
no scope is specified, the scope defaults to runtime."

Anyone know what the real deal is?

Mark

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


Re: Project.getArtifacts Does Not Return Provided Artifacts

Posted by Mark Hobson <ma...@gmail.com>.
2008/7/22 Brian E. Fox <br...@reply.infinity.nu>:
> The real default is whatever the last plugin requested. I'm sure of it
> because it hosed me trying to do the 2.0.8 release when a plugin changed
> the dependency resolution and broke later plugins. This is wrong and
> there's a jira for it: http://jira.codehaus.org/browse/MNG-3297

Right, so does this issue imply that @requireDependencyResolution
should always require a scope?  If so we should update the
documentation to say that there is no default scope.

Mark

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


RE: Project.getArtifacts Does Not Return Provided Artifacts

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
>Under requiresDependencyResolution, "If this annotation is present but
>no scope is specified, the scope defaults to runtime."

>Anyone know what the real deal is?

The real default is whatever the last plugin requested. I'm sure of it
because it hosed me trying to do the 2.0.8 release when a plugin changed
the dependency resolution and broke later plugins. This is wrong and
there's a jira for it: http://jira.codehaus.org/browse/MNG-3297

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


Re: Project.getArtifacts Does Not Return Provided Artifacts

Posted by Mark Hobson <ma...@gmail.com>.
2008/7/22 Benjamin Bentmann <be...@udo.edu>:
> What the Mojo API specification is meant to say is that the mere notation of
>
>  @requiresDependencyResolution
>
> is equivalent to the complete form
>
>  @requiresDependencyResolution runtime
>
> This is realized by the maven-plugin-tools-java [0] and can be verified by a
> simple test mojo whose plugin descriptor will contain
>
>  <requiresDependencyResolution>runtime</requiresDependencyResolution>
>
> after running the "generate-resources" phase.
>
> To summarize: There is a difference in omitting just the phase argument of
> the annotation and omitting the annotation completely.
>
> Hope that clarifies things a little.

Thanks, this is what I gathered too.  I thought Brian was saying that
omitting the scope from @rDR caused indeterminate behaviour, although
after rereading this thread I see that he's referring to the case
where @rDR is specified without a corresponding @phase annotation, not
simply without a scope attribute.  Sorry for the noise :)

Mark

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


Re: Project.getArtifacts Does Not Return Provided Artifacts

Posted by Benjamin Bentmann <be...@udo.edu>.
Mark Hobson wrote:

> http://maven.apache.org/developers/mojo-api-specification.html
> 
> Under requiresDependencyResolution, "If this annotation is present but
> no scope is specified, the scope defaults to runtime."

What the Mojo API specification is meant to say is that the mere notation of

   @requiresDependencyResolution

is equivalent to the complete form

   @requiresDependencyResolution runtime

This is realized by the maven-plugin-tools-java [0] and can be verified 
by a simple test mojo whose plugin descriptor will contain

   <requiresDependencyResolution>runtime</requiresDependencyResolution>

after running the "generate-resources" phase.

To summarize: There is a difference in omitting just the phase argument 
of the annotation and omitting the annotation completely.

Hope that clarifies things a little.


Benjamin


[0] 
http://maven.apache.org/plugin-tools/maven-plugin-tools-java/xref/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.html#319

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