maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason van Zyl <>
Subject Re: @component or @plexus.requirement?
Date Thu, 19 Mar 2009 14:34:01 GMT
One annotation is for Plexus components specifically and that is  
@plexus.requirement or @Requirement if you're doing annotations.

The other is specifically for Maven plugins. The component metadata  
for your own types, like our Maven plugins, have their own component  
descriptors which are mutated on the fly inside Plexus.

But for a Maven plugin that also contains other Plexus components you  
need to use @plexus.requirement/@Requirement with your Plexus  
components and @component in your Mojo-based classes. Maven plugins  
may often not contain any Plexus components so the use of the type of  
annotations is completely partitioned. Take a look at Maven trunk if  
you want to see examples of the annotations used for Plexus components.

On 19-Mar-09, at 7:05 AM, Ringo De Smet wrote:

> Hello,
> I'm a bit confused on the use of the @component and
> @plexus.requirement Javadoc annotations.
> +Planning
> The above document contains the following: "injected either as a
> @plexus.requirement or @component annotation, depending on whether
> you're writing a Plexus component or an implementation of the Mojo
> interface"
> Within a complete Maven plugin implementation, where is the boundary
> for the set of classes where I have to use @component annotation? Is
> it only in the real plugin class (extending AbstractMojo) where I have
> to use @component? Use @plexus.requirement for the rest?
> Please enlighten me!
> Ringo
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:



Jason van Zyl
Founder,  Apache Maven

happiness is like a butterfly: the more you chase it, the more it will
elude you, but if you turn your attention to other things, it will come
and sit softly on your shoulder ...

  -- Thoreau

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message