You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Shane Isbell <sh...@gmail.com> on 2007/12/31 21:40:53 UTC
Project.getArtifacts Does Not Return Provided Artifacts
I'm using maven 2.0.7 client. I have a Mojo implementation with the @phase
compiler and @requiresDependencyResolution parameters set. The
project.getArtifacts method does not return artifacts with the scope
'provided'. The method project.getDependencyArtifacts does return dependent
artifacts with the scope 'provided'. Is this expected behavior of the API?
Thanks,
Shane
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
Re: Project.getArtifacts Does Not Return Provided Artifacts
Posted by Mark Hobson <ma...@gmail.com>.
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 "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)
-----Original Message-----
From: Shane Isbell [mailto:shane.isbell@gmail.com]
Sent: Monday, December 31, 2007 4:37 PM
To: Maven Developers List
Subject: Re: Project.getArtifacts Does Not Return Provided Artifacts
Thanks Brian, specifying compile after @requiresDependencyResolution
works.
>From what I can tell, the behavior is:
@requiresDependencyResolution with unspecified phase
* MavenProject.getArtifacts returns set of artifacts: {compile}
* MavenProject.getDependencyArtifacts returns set of direct
dependency artifacts: {compile, test, runtime, system, provided}
@requiresDependencyResolution with compile phase
* MavenProject.getArtifacts returns set of artifacts: {compile, runtime,
system, provided}
Is there any case where I shouldn't specify a phase for
@requiresDependencyResolution?
Thanks,
Shane
On Dec 31, 2007 1:07 PM, Brian E. Fox <br...@reply.infinity.nu> wrote:
> Hi Shane, what scope did you specify after
> @requiresDependencyResolution? (you need to put a scope there or it
> won't work...)
>
> -----Original Message-----
> From: Shane Isbell [mailto:shane.isbell@gmail.com]
> Sent: Monday, December 31, 2007 3:41 PM
> To: Maven Developers List
> Subject: Project.getArtifacts Does Not Return Provided Artifacts
>
> I'm using maven 2.0.7 client. I have a Mojo implementation with the
> @phase
> compiler and @requiresDependencyResolution parameters set. The
> project.getArtifacts method does not return artifacts with the scope
> 'provided'. The method project.getDependencyArtifacts does return
> dependent
> artifacts with the scope 'provided'. Is this expected behavior of the
> API?
>
> Thanks,
> Shane
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
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 Shane Isbell <sh...@gmail.com>.
Thanks Brian, specifying compile after @requiresDependencyResolution works.
>From what I can tell, the behavior is:
@requiresDependencyResolution with unspecified phase
* MavenProject.getArtifacts returns set of artifacts: {compile}
* MavenProject.getDependencyArtifacts returns set of direct
dependency artifacts: {compile, test, runtime, system, provided}
@requiresDependencyResolution with compile phase
* MavenProject.getArtifacts returns set of artifacts: {compile, runtime,
system, provided}
Is there any case where I shouldn't specify a phase for
@requiresDependencyResolution?
Thanks,
Shane
On Dec 31, 2007 1:07 PM, Brian E. Fox <br...@reply.infinity.nu> wrote:
> Hi Shane, what scope did you specify after
> @requiresDependencyResolution? (you need to put a scope there or it
> won't work...)
>
> -----Original Message-----
> From: Shane Isbell [mailto:shane.isbell@gmail.com]
> Sent: Monday, December 31, 2007 3:41 PM
> To: Maven Developers List
> Subject: Project.getArtifacts Does Not Return Provided Artifacts
>
> I'm using maven 2.0.7 client. I have a Mojo implementation with the
> @phase
> compiler and @requiresDependencyResolution parameters set. The
> project.getArtifacts method does not return artifacts with the scope
> 'provided'. The method project.getDependencyArtifacts does return
> dependent
> artifacts with the scope 'provided'. Is this expected behavior of the
> API?
>
> Thanks,
> Shane
>
> ---------------------------------------------------------------------
> 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>.
Hi Shane, what scope did you specify after
@requiresDependencyResolution? (you need to put a scope there or it
won't work...)
-----Original Message-----
From: Shane Isbell [mailto:shane.isbell@gmail.com]
Sent: Monday, December 31, 2007 3:41 PM
To: Maven Developers List
Subject: Project.getArtifacts Does Not Return Provided Artifacts
I'm using maven 2.0.7 client. I have a Mojo implementation with the
@phase
compiler and @requiresDependencyResolution parameters set. The
project.getArtifacts method does not return artifacts with the scope
'provided'. The method project.getDependencyArtifacts does return
dependent
artifacts with the scope 'provided'. Is this expected behavior of the
API?
Thanks,
Shane
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org