From users-return-131010-apmail-maven-users-archive=maven.apache.org@maven.apache.org Fri Feb 1 11:13:27 2013 Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 96973E11B for ; Fri, 1 Feb 2013 11:13:27 +0000 (UTC) Received: (qmail 84894 invoked by uid 500); 1 Feb 2013 11:13:25 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 84666 invoked by uid 500); 1 Feb 2013 11:13:22 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 84631 invoked by uid 99); 1 Feb 2013 11:13:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2013 11:13:21 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mcculls@gmail.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-wg0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2013 11:13:14 +0000 Received: by mail-wg0-f44.google.com with SMTP id dr12so2716998wgb.11 for ; Fri, 01 Feb 2013 03:12:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=+Nccy9DrtmHFobif+U/FZGwyqWkC8t6aCVUd5cBQuRo=; b=dVIon7h3lb/U4uXOpHOsHyMoWo6znkWC3k+t2tRwH65/3/U9SUHAIIb0b/U1Q+wtbo BiR3eQrAbC2Yqdfrfenr4k3qInNZ4PoVHlKfUWh4bkvVFBgxX0HD2WvLyjN82SKcTrTr XmVDhFElqcoIHWrtc59bmhHvBYisWhbnCzrnDhKG5LPFb2oEnt4ay02+QTJcXj2eGtp5 4tEqPLUxoTjxdzDFNDY6xFSCBHhTiDUVcxK72+Pu5IQLashiSW+j8bBYx0iSyTQ7X4UO 0HxzprHGYgs25E8rP3makUWaFUSjZWM1gFjOnoe4OXXMvGzoxhn+k0wJmY7VOaz3nKfN GBkQ== MIME-Version: 1.0 X-Received: by 10.180.93.100 with SMTP id ct4mr1735958wib.32.1359717174501; Fri, 01 Feb 2013 03:12:54 -0800 (PST) Received: by 10.217.61.138 with HTTP; Fri, 1 Feb 2013 03:12:54 -0800 (PST) In-Reply-To: References: Date: Fri, 1 Feb 2013 11:12:54 +0000 Message-ID: Subject: Re: Possible PluginManager interaction with Guice bug From: Stuart McCulloch To: Maven Users List Content-Type: multipart/alternative; boundary=f46d043d67732e616504d4a7d377 X-Virus-Checked: Checked by ClamAV on apache.org --f46d043d67732e616504d4a7d377 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 31 January 2013 21:29, Martin Gainty wrote: > > Gentlemen > I found a consistent bug with PluginManager not able to locate @goal/** * > artifactId=3Dmodello-maven-plugin > * @author Trygve Laugst=F8l > * @version 1.5 > * @threadSafe > */ > public abstract class AbstractModelloGeneratorMojo extends AbstractMojo > notice the lack of @goal .. because this is an abstract class which is > expected to be extend'ed by a concrete > the PluginManager backtraces classes to find who is extending AbstractMoj= o > and correctly identifies > org.codehaus.modello.maven.AbstractModelloGeneratorMojo > org.apache.maven.plugin.MojoExecutionException: Error generating: No such > plugin: java > at > org.codehaus.modello.maven.AbstractModelloGeneratorMojo.doExecute(Abstrac= tModelloGeneratorMojo.java:324) > > abstract class AbstractModelloGeneratorMojo has no @goal .. pluginManager > will always throw MojoExecutionException > > solution is to have the concrete class which contains annotated @goal > extend AbstractMojo > /*** Echos an object string to the output screen. > * @goal java > * @requiresProject false > @Mojo(name "java") > */ > public class ModelloJavaMojo extends AbstractMojo implements > org.codehaus.modello.core.ModelloCore > { public void execute() > } > > if I run mvn dependency:tree i can see the guice injector the > modello-maven-plugin is expecting > [DEBUG] org.codehaus.modello:modello-maven-plugin:maven-plugin:1.1 > [DEBUG] com.google.inject:guice:jar:2.0:compile > > maven-core implements guice as well > [DEBUG] org.apache.maven:maven-core:jar:3.0.2:compile > [DEBUG] org.sonatype.sisu:sisu-guice:jar:2.9.1:compile > > the options seem to be > 1)disable guice and replace with plexus..if you find a way please let me > know > 2)refactor all concrete classes which already implement @goal to extend > AbstractMojo so PluginManager will > find the Mojo which contains the expected goal from plugin.xml > > Thoughts? > Don't see how this relates to guice, seems more likely to be something to do with the build-time generation of the plugin.xml. Suggest you create an issue on http://jira.codehaus.org/browse/MPLUGIN and attach your test project. Also I don't see anywhere in the PluginManager implementation where it "backtraces classes to find who is extending AbstractMojo", instead it looks up the implementation indirectly via the MojoDescriptor that's populated from the plugin.xml. --=20 Cheers, Stuart > Martin Gainty > --f46d043d67732e616504d4a7d377--