maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: Possible PluginManager interaction with Guice bug
Date Fri, 01 Feb 2013 12:04:53 GMT

Stuart
Yes i agree that the PluginManager *should* be discovering the implementor at <mojo>
<implementation> for Java class but instead pulls in AbstractModelloGeneratorMojo which
extends AbstractMojo
Jira entry
http://jira.codehaus.org/browse/MPLUGIN-240?focusedCommentId=318476#comment-318476
Thanks,
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten
wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist
unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet
keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen
wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire
prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe
quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information
seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les
email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune
responsabilité pour le contenu fourni.

 > Date: Fri, 1 Feb 2013 11:12:54 +0000
> Subject: Re: Possible PluginManager interaction with Guice bug
> From: mcculls@gmail.com
> To: users@maven.apache.org
> 
> On 31 January 2013 21:29, Martin Gainty <mgainty@hotmail.com> wrote:
> 
> >
> > Gentlemen
> > I found a consistent bug with PluginManager not able to locate @goal/** *
> > artifactId=modello-maven-plugin
> >  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
> >  * @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 AbstractMojo
> > 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(AbstractModelloGeneratorMojo.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.
> 
> -- 
> Cheers, Stuart
> 
> 
> > Martin Gainty
> >
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message