Does anyone haven any ideas on how to fix this?

My guess is that the custom life-cycle that the site bits are forking
is somehow not picking up the extra dependencies which need to be
configured on the maven-plugin-plugin... and which are configured for
normal builds, but freak out when generating the site in a
multi-module reactor-based build.

I've started to add some simple examples to the Groovy Maven
integration.  I just added an example of the "clean" plugin
implemented in Groovy.  This shows how the build breaks down when
running "site", as in:

   svn co http://svn.codehaus.org/mojo/trunk/mojo/groovy mojo-groovy
   cd mojo-groovy
   mvn install site

This will get all the way to the examples/clean-maven-plugin, and then barf:

<snip>
[INFO] 
----------------------------------------------------------------------------
[INFO] Building Clean Maven Plugin
[INFO]    task-segment: [install, site, site:deploy]
[INFO] 
----------------------------------------------------------------------------
[INFO] [plugin:descriptor]
[INFO] Using 2 extractors.
[INFO] Applying extractor for language: java
[INFO] Extractor for language: java found 0 mojo descriptors.
[INFO] Applying extractor for language: bsh
[INFO] Extractor for language: bsh found 0 mojo descriptors.
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [groovy:compile {execution: default}]
[INFO] Compiling 1 Groovy source file to
/Users/jason/ws/maven/mojo/groovy/examples/clean-maven-plugin/target/classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] Building jar:
/Users/jason/ws/maven/mojo/groovy/examples/clean-maven-plugin/target/clean-maven-plugin-1.0-beta-1-SNAPSHOT.jar
[INFO] [plugin:addPluginArtifactMetadata]
[INFO] [install:install]
[INFO] Installing
/Users/jason/ws/maven/mojo/groovy/examples/clean-maven-plugin/target/clean-maven-plugin-1.0-beta-1-SNAPSHOT.jar
to 
/Users/jason/.m2/repository/org/codehaus/mojo/groovy/examples/clean-maven-plugin/1.0-beta-1-SNAPSHOT/clean-maven-plugin-1.0-beta-1-SNAPSHOT.jar
[INFO] [plugin:updateRegistry]
[INFO] Preparing javadoc:javadoc
[INFO] No goals needed for project - skipping
[INFO] Preparing surefire-report:report
[INFO] [plugin:descriptor]
[INFO] Using 2 extractors.
[INFO] Applying extractor for language: java
[INFO] Extractor for language: java found 0 mojo descriptors.
[INFO] Applying extractor for language: bsh
[INFO] Extractor for language: bsh found 0 mojo descriptors.
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [groovy:compile {execution: default}]
[INFO] Compiling 1 Groovy source file to
/Users/jason/ws/maven/mojo/groovy/examples/clean-maven-plugin/target/classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] Preparing surefire-report:report-only
[INFO] No goals needed for project - skipping
[INFO] [site:site]
[INFO] Skipped "Maven Surefire Report" report, file
"surefire-report.html" already exists for the English version.
[INFO] Generate "Plugin documentation" report.
[INFO] Using 2 extractors.
[INFO] Applying extractor for language: java
[INFO] Extractor for language: java found 0 mojo descriptors.
[INFO] Applying extractor for language: bsh
[INFO] Extractor for language: bsh found 0 mojo descriptors.
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] null
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NullPointerException
       at 
org.apache.maven.tools.plugin.generator.PluginXdocGenerator.execute(PluginXdocGenerator.java:46)
       at 
org.apache.maven.plugin.plugin.PluginReport.generatePluginDocumentation(PluginReport.java:192)
       at 
org.apache.maven.plugin.plugin.PluginReport.executeReport(PluginReport.java:141)
       at 
org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
       at 
org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument(ReportDocumentRenderer.java:67)
       at 
org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:239)
       at 
org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:115)
       at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:124)
       at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:92)
       at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
       at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
       at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
       at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
       at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
       at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
       at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
       at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
       at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
</snip>

You can see its not picking up any Groovy mojo descriptors, not even
trying to look for them.  Though if you just run `mvn install`, then
you'll see that it works as expected, finding the 1 "groovy" mojo:

<snip>
[INFO] [plugin:descriptor]
[INFO] Using 3 extractors.
[INFO] Applying extractor for language: java
[INFO] Extractor for language: java found 0 mojo descriptors.
[INFO] Applying extractor for language: bsh
[INFO] Extractor for language: bsh found 0 mojo descriptors.
[INFO] Applying extractor for language: groovy
[INFO] Extractor for language: groovy found 1 mojo descriptors.
</snip>

Can someone please help me figure out what is going on?  Generating a
site from a Maven project is one of the highlights of using Maven...
and its a huge PITA that this is not working with plugins implemented
in custom languages.

Any ideas or hints on how to fix this or workaround for the time-being
would be *very* helpful.

Thanks,

--jason


On 5/13/07, Jason Dillon <[EMAIL PROTECTED]> wrote:
As many of you know I've been working on Groovy integration for Maven
2... and I've recently (er well a few weeks ago) gotten things hooked
up to allow mojos to be implemented in Groovy.

I've started to use this to build other plugins, but I've just run
into a rather annoying problem with the site plugin, in that it is
not correctly picking up the dependency configuration of the maven-
plugin-plugin when generating the plugin's descriptor in the reactor.

Too hook up the Groovy bits you basically need something like this:

----8<----
<project>
....
     <packaging>maven-plugin</packaging>
....
     <build>
         <plugins>
             <plugin>
                 <groupId>org.codehaus.mojo.groovy</groupId>
                 <artifactId>groovy-maven-plugin</artifactId>
                 <version>1.0-alpha-3-SNAPSHOT</version>
                 <executions>
                     <execution>
                         <goals>
                             <goal>compile</goal>
                         </goals>
                     </execution>
                 </executions>
             </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-plugin-plugin</artifactId>
                 <dependencies>
                     <dependency>
                         <groupId>org.codehaus.mojo.groovy</groupId>
                         <artifactId>groovy-mojo-tools</artifactId>
                         <version>1.0-alpha-3-SNAPSHOT</version>
                     </dependency>
                 </dependencies>
             </plugin>
         </plugins>
     </build>
</project>
---->8----

When running `mvn install`, either from the module directory, or when
using the reactor, everything works fine as expected, and it spits
out something like:

<snip>
[INFO] [plugin:descriptor]
[INFO] Using 3 extractors.
[INFO] Applying extractor for language: java
[INFO] Extractor for language: java found 0 mojo descriptors.
[INFO] Applying extractor for language: bsh
[INFO] Extractor for language: bsh found 0 mojo descriptors.
[INFO] Applying extractor for language: groovy
[INFO] Extractor for language: groovy found 1 mojo descriptors.
</snip>

If you run `mvn site` from the module directory, it also works just
fine.  BUT, if you run `mvn site` using the reactor, then when it
gets to the maven-plugin with the above configuration to hookup
Groovy support, then report fails:

<snip>
[INFO] Generate "Plugin documentation" report.
[INFO] Using 2 extractors.
[INFO] Applying extractor for language: java
[INFO] Extractor for language: java found 0 mojo descriptors.
[INFO] Applying extractor for language: bsh
[INFO] Extractor for language: bsh found 0 mojo descriptors.
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] null
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.NullPointerException
         at
org.apache.maven.tools.plugin.generator.PluginXdocGenerator.execute
(PluginXdocGenerator.java:46)
         at
org.apache.maven.plugin.plugin.PluginReport.generatePluginDocumentation(
PluginReport.java:192)
         at org.apache.maven.plugin.plugin.PluginReport.executeReport
(PluginReport.java:141)
         at org.apache.maven.reporting.AbstractMavenReport.generate
(AbstractMavenReport.java:98)
         at
org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument
(ReportDocumentRenderer.java:67)
         at
org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule
(DefaultSiteRenderer.java:239)
         at
org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render
(DefaultSiteRenderer.java:115)
         at org.apache.maven.plugins.site.SiteMojo.renderLocale
(SiteMojo.java:124)
         at org.apache.maven.plugins.site.SiteMojo.execute
(SiteMojo.java:92)
         at org.apache.maven.plugin.DefaultPluginManager.executeMojo
(DefaultPluginManager.java:443)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals
(DefaultLifecycleExecutor.java:539)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec
ycle(DefaultLifecycleExecutor.java:480)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal
(DefaultLifecycleExecutor.java:459)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle
Failures(DefaultLifecycleExecutor.java:311)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:278)
         at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute
(DefaultLifecycleExecutor.java:143)
         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:
334)
         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
         at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.codehaus.classworlds.Launcher.launchEnhanced
(Launcher.java:315)
         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
         at org.codehaus.classworlds.Launcher.mainWithExitCode
(Launcher.java:430)
         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
</snip>

and the descriptor generation that happens at the very beginning also
fails (even though when run with `mvn install` this works just fine):

<snip>
[INFO] [plugin:descriptor]
[INFO] Using 2 extractors.
[INFO] Applying extractor for language: java
[INFO] Extractor for language: java found 0 mojo descriptors.
[INFO] Applying extractor for language: bsh
[INFO] Extractor for language: bsh found 0 mojo descriptors.
</snip>

  * * *

This is highly annoying... as it basically means that I can not
generate sites from multi-module builds which have maven-plugins
implemented in Groovy (or really, any other custom language).

Is there a way around this problem... or better yet how can we get
this fixed so that when the site plugin executes in the reactor that
it picks up the correct dependencies for the maven-plugin-plugin and
generates the proper plugin descriptor?

--jason



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

Reply via email to