That was a copy & paste issue. I copied the javadoc tag from the IdeaPlugin.

I changed that javadoc tag & now get 

      <phase>generate-sources</phase>

I also fixed a bunch of typos & also removed the intermediate
AbstractGeneratorMojo (the NPE issue that was a red herring), so now I get
no errors, but no evidence of my plugin getting called

[INFO] Building Intermedi8 Core
[INFO]
----------------------------------------------------------------------------
[INFO] intermedi8-protege-plugin: using locally installed snapshot
[INFO] [resources:resources]
[INFO] intermedi8-roadmap-plugin: using locally installed snapshot
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [resources:testResources]
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] Setting reports dir:
C:\proj\682\apps\intermedi8\intermedi8-core\target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no test to run.

Results :
[surefire] Tests run: 0, Failures: 0, Errors: 0

[INFO] [jar:jar]
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar:
C:\proj\682\apps\intermedi8\intermedi8-core\target\intermedi8-core-0.1-SNAPS
HOT.jar
[INFO] [install:install]
[INFO] Installing
C:\proj\682\apps\intermedi8\intermedi8-core\target\intermedi8-core-0.1-SNAPS
HOT.jar to C:\Documents and Settings\m
pryor\.m2\repository\net\mobiquity\intermedi8-core\0.1-SNAPSHOT\intermedi8-c
ore-0.1-SNAPSHOT.jar
[INFO]
----------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
----------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Mon May 23 11:20:13 EST 2005
[INFO] Final Memory: 2M/4M
[INFO]
----------------------------------------------------------------------------

How can I get better information about what plugins are getting called?

Any other hints to get a better diagnosis?

Thanks,
Matthew 

> -----Original Message-----
> From: Brett Porter [mailto:[EMAIL PROTECTED] 
> Sent: Monday, May 23, 2005 11:12 AM
> To: [EMAIL PROTECTED]
> Cc: Maven Users List
> Subject: Re: [m2] writing a plugin that generates Java code
> 
> The <executePhase> part looks incorrect to me, and might 
> explain the problem as it would essentially setup an infinite 
> loop in the lifecycle and might explain why the plugin 
> version isn't discovered.
> 
> Regardless, this would be a bug that it is not reported as an 
> error properly.
> 
> I'm not sure why it is there, given you don't list it in your javadoc.
> Can you confirm that it really is the same?
> 
> Thanks,
> Brett
> 
> On 5/23/05, J. Matthew Pryor <[EMAIL PROTECTED]> wrote:
> > I am trying to write a plugin that will generate source 
> code prior to 
> > compilation, but the plugin fails when it gets called.
> > 
> > The plugin looks like this:
> > 
> > /**
> >  * @phase generate-sources
> >  * @goal bean
> >  * @author mpryor
> >  *
> >  */
> > public class ProtegeBeanGeneratorMojo extends 
> AbstractGeneratorMojo {
> > 
> >     /**
> >      * @parameter 
> expression="${project.build.directory}/generated-sources"
> >      * @required
> >      */
> >     protected File outputDirectory;
> > [snip]
> > }
> > 
> > POM snippet
> > 
> > <project>
> >   <modelVersion>4.0.0</modelVersion>
> >   <parent>
> >     <artifactId>intermedi8-parent</artifactId>
> >     <groupId>net.mobiquity</groupId>
> >     <version>0.1-SNAPSHOT</version>
> >   </parent>
> >   <artifactId>intermedi8-protege-plugin</artifactId>
> >   <version>0.1-SNAPSHOT</version>
> >   <packaging>maven-plugin</packaging>
> >   <name>Intermedi8 Protege Plugin</name>
> >   <dependencies>
> > 
> > It builds and installs fine, with what appears to be a well formed
> > plugin.xml:
> > 
> > <plugin>
> >   <groupId>net.mobiquity</groupId>
> >   <artifactId>intermedi8-protege-plugin</artifactId>
> >   <isolatedRealm>true</isolatedRealm>
> >   <mojos>
> >     <mojo>
> >       <id>protege:bean</id>
> >       
> <requiresDependencyResolution>runtime</requiresDependencyResolution>
> >       <phase>generate-sources</phase>
> >       <executePhase>generate-sources</executePhase>
> > 
> > 
> <implementation>net.mobiquity.intermedi8.tools.protege.ProtegeBeanGene
> > ratorM
> > ojo</implementation>
> >       <language>java</language>
> >       <instantiationStrategy>per-lookup</instantiationStrategy>
> >       <executionStrategy>once-per-session</executionStrategy>
> >       <parameters>
> >         <parameter>
> > [snip]
> > 
> > I have another project that uses the plugin, configured like this:
> > 
> > 
> >   <build>
> >         <plugins>
> >                 <plugin>
> >                 <groupId>net.mobiquity</groupId>
> >                 <artifactId>intermedi8-protege-plugin</artifactId>
> >                 <version>0.1-SNAPSHOT</version>
> >                 <configuration>
> > 
> > 
> <protogeProject>${maven.src.dir}/ontology/intermedi8.pprj/</pr
> otogeProject>
> >                 </configuration>
> >                 </plugin>
> >         </plugins>
> > 
> > But the build fails with the following :
> > 
> > C:\proj\682\apps\intermedi8\intermedi8-core>m2 -X -e install [INFO] 
> > intermedi8-parent: using locally installed snapshot [INFO]
> > 
> ----------------------------------------------------------------------
> > ------
> > [INFO] Building Intermedi8 Core
> > [INFO]
> > 
> ----------------------------------------------------------------------
> > ------ [INFO] maven-jar-plugin: using locally installed snapshot 
> > [INFO] maven-archiver: using locally installed snapshot 
> [INFO] maven: 
> > using locally installed snapshot [INFO] intermedi8-protege-plugin: 
> > using locally installed snapshot [INFO] 
> maven-resources-plugin: using 
> > locally installed snapshot [INFO] maven-compiler-plugin: 
> using locally 
> > installed snapshot [INFO] plexus-compiler-api: using 
> locally installed 
> > snapshot [INFO] plexus-compiler: using locally installed snapshot 
> > [INFO] plexus-compiler-javac: using locally installed 
> snapshot [INFO] 
> > plexus-compilers: using locally installed snapshot [INFO] 
> > maven-surefire-plugin: using locally installed snapshot [INFO] 
> > maven-install-plugin: using locally installed snapshot
> > ---------------------------------------------------
> > constituent[0]: 
> > file:/C:/dev/maven/m2dev/lib/commons-cli-1.0-beta-2.jar
> > constituent[1]: 
> > file:/C:/dev/maven/m2dev/lib/maven-artifact-2.0-SNAPSHOT.jar
> > constituent[2]: 
> > file:/C:/dev/maven/m2dev/lib/maven-core-2.0-SNAPSHOT.jar
> > constituent[3]: 
> > file:/C:/dev/maven/m2dev/lib/maven-model-2.0-SNAPSHOT.jar
> > constituent[4]: 
> > file:/C:/dev/maven/m2dev/lib/maven-monitor-2.0-SNAPSHOT.jar
> > constituent[5]:
> > file:/C:/dev/maven/m2dev/lib/maven-plugin-api-2.0-SNAPSHOT.jar
> > constituent[6]:
> > 
> file:/C:/dev/maven/m2dev/lib/maven-plugin-descriptor-2.0-SNAPSHOT.jar
> > constituent[7]: 
> > file:/C:/dev/maven/m2dev/lib/maven-project-2.0-SNAPSHOT.jar
> > constituent[8]: 
> > file:/C:/dev/maven/m2dev/lib/maven-settings-2.0-SNAPSHOT.jar
> > constituent[9]:
> > 
> file:/C:/dev/maven/m2dev/lib/plexus-container-artifact-1.0-alp
> ha-3-SNAPSHOT.
> > jar
> > constituent[10]: 
> > file:/C:/dev/maven/m2dev/lib/plexus-i18n-1.0-beta-3.jar
> > constituent[11]:
> > 
> file:/C:/dev/maven/m2dev/lib/wagon-http-lightweight-1.0-alpha-3-SNAPSH
> > OT.jar
> > constituent[12]:
> > 
> file:/C:/dev/maven/m2dev/lib/wagon-provider-api-1.0-alpha-3-SNAPSHOT.j
> > ar
> > ---------------------------------------------------
> > java.lang.NullPointerException: version was null for 
> > org.apache.maven.plugins:maven-protege-plugin
> >         at
> > 
> org.apache.maven.artifact.DefaultArtifact.getBaseVersion(DefaultArtifa
> > ct.jav
> > a:246)
> >         at
> > 
> org.apache.maven.artifact.DefaultArtifact.getId(DefaultArtifac
> t.java:159)
> >         at
> > 
> org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(Def
> > aultAr
> > tifactResolver.java:77)
> >         at
> > 
> org.codehaus.plexus.DefaultArtifactEnabledContainer.addComponent(Defau
> > ltArti
> > factEnabledContainer.java:104)
> >         at
> > 
> org.apache.maven.plugin.DefaultPluginManager.addPlugin(Default
> PluginManager.
> > java:282)
> >         at
> > 
> org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPlugi
> > nManag
> > er.java:241)
> >         at
> > 
> org.apache.maven.plugin.DefaultPluginManager.verifyPluginForGoal(Defau
> > ltPlug
> > inManager.java:195)
> >         at
> > 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeMojo(Defaul
> > tLifec
> > ycleExecutor.java:478)
> >         at
> > 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executePhase(Defau
> > ltLife
> > cycleExecutor.java:436)
> >         at
> > 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.processGoals(Defau
> > ltLife
> > cycleExecutor.java:164)
> >         at
> > 
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLif
> > ecycle
> > Executor.java:94)
> >         at
> > org.apache.maven.DefaultMaven.processProject(DefaultMaven.java:222)
> >         at 
> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:136)
> >         at org.apache.maven.cli.MavenCli.main(MavenCli.java:217)
> >         at 
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >         at
> > 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> > ava:39
> > )
> >         at
> > 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > orImpl
> > .java:25)
> >         at java.lang.reflect.Method.invoke(Method.java:324)
> >         at
> > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:303)
> >         at 
> org.codehaus.classworlds.Launcher.launch(Launcher.java:243)
> >         at
> > 
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:416)
> >         at org.codehaus.classworlds.Launcher.main(Launcher.java:363)
> > 
> > 
> > Any clues as to what I have done wrong ?
> > 
> > Thanks,
> > Matthew
> > 
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to