Return-Path: Delivered-To: apmail-maven-dev-archive@www.apache.org Received: (qmail 15098 invoked from network); 19 Mar 2009 14:34:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Mar 2009 14:34:37 -0000 Received: (qmail 73221 invoked by uid 500); 19 Mar 2009 14:34:35 -0000 Delivered-To: apmail-maven-dev-archive@maven.apache.org Received: (qmail 73111 invoked by uid 500); 19 Mar 2009 14:34:35 -0000 Mailing-List: contact dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Developers List" Reply-To: "Maven Developers List" Delivered-To: mailing list dev@maven.apache.org Received: (qmail 73100 invoked by uid 99); 19 Mar 2009 14:34:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Mar 2009 07:34:35 -0700 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [64.18.2.20] (HELO exprod7og121.obsmtp.com) (64.18.2.20) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 19 Mar 2009 14:34:25 +0000 Received: from source ([209.85.198.226]) by exprod7ob121.postini.com ([64.18.6.12]) with SMTP ID DSNKScJX3Bg1ICl0oRJVOF4C+K03bUJDh8hc@postini.com; Thu, 19 Mar 2009 07:34:05 PDT Received: by rv-out-0506.google.com with SMTP id g9so640292rvb.5 for ; Thu, 19 Mar 2009 07:34:04 -0700 (PDT) Received: by 10.115.107.1 with SMTP id j1mr1679532wam.165.1237473243985; Thu, 19 Mar 2009 07:34:03 -0700 (PDT) Received: from ?10.0.1.201? (c-24-6-189-155.hsd1.ca.comcast.net [24.6.189.155]) by mx.google.com with ESMTPS id m17sm1182254waf.31.2009.03.19.07.34.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 19 Mar 2009 07:34:03 -0700 (PDT) Message-Id: <2186A793-C986-4BF8-B9CC-F39D20830D27@sonatype.com> From: Jason van Zyl To: "Maven Developers List" In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: @component or @plexus.requirement? Date: Thu, 19 Mar 2009 07:34:01 -0700 References: X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org 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. > > http://docs.codehaus.org/display/MAVEN/Deterministic+Lifecycle > +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: dev-unsubscribe@maven.apache.org > For additional commands, e-mail: dev-help@maven.apache.org > Thanks, Jason ---------------------------------------------------------- Jason van Zyl Founder, Apache Maven http://twitter.com/jvanzyl ---------------------------------------------------------- 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: dev-unsubscribe@maven.apache.org For additional commands, e-mail: dev-help@maven.apache.org