Uploaded image for project: 'Maven Plugin Tools'
  1. Maven Plugin Tools
  2. MPLUGIN-65

[PATCH] NPE in PluginXDocGenerator while creating plugin site

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4
    • API
    • None

    Description

      I'm running into (what appears to be) the exact same problem that Tom Huybrechts described on the Maven user list a few months ago (quoted below), with Maven v2.0.6, maven-plugin-plugin v2.3, and maven-plugin-tools-api v2.1.

      I attach a patch that fixes the problem for me.

      Output:

      [INFO] [site:site]
      [INFO] Skipped "About" report, file "index.html" already exists for the
      English version.
      [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 3 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.filterParameters(PluginXdocGenerator.java:253)
      at
      org.apache.maven.tools.plugin.generator.PluginXdocGenerator.writeGoalParameterTable(PluginXdocGenerator.java:239)
      at
      org.apache.maven.tools.plugin.generator.PluginXdocGenerator.writeBody(PluginXdocGenerator.java:122)
      at
      org.apache.maven.tools.plugin.generator.PluginXdocGenerator.processMojoDescriptor(PluginXdocGenerator.java:61)
      at
      org.apache.maven.tools.plugin.generator.PluginXdocGenerator.execute(PluginXdocGenerator.java:49)
      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: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)

      On 2007-01-03, Tom Huybrechts wrote:
      > > Hi folks,
      > >
      > > I'm getting aNPE when generating a site for a plugin. It looks like
      > > the java mojos get processed OK, but when it looks for bsh mojos
      > > (which I don't have) the NPE is thrown.
      > >
      > > Running 2.0.4 with the latest releases of all plugins
      > >
      > > Any tips ?
      > >
      > > [INFO] [site:site]
      > > [WARNING] No URL defined for the project - decoration links will not be resolved
      > > [INFO] Generate "Plugin documentation" report.
      > > [INFO] Using 2 extractors.
      > > [INFO] Applying extractor for language: java
      > > [INFO] Extractor for language: java found 15 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.filterParameters(PluginXdocGenerator.java:245)
      > > at org.apache.maven.tools.plugin.generator.PluginXdocGenerator.writeGoalParameterTable(PluginXdocGenerator.java:231)
      > > at org.apache.maven.tools.plugin.generator.PluginXdocGenerator.writeBody(PluginXdocGenerator.java:122)
      > > at org.apache.maven.tools.plugin.generator.PluginXdocGenerator.processMojoDescriptor(PluginXdocGenerator.java:61)
      > > at org.apache.maven.tools.plugin.generator.PluginXdocGenerator.execute(PluginXdocGenerator.java:49)
      > > 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)

      Attachments

        1. PluginXdocGenerator.patch
          2 kB
          Jason Melnick
        2. PluginXdocGenerator.diff
          1 kB
          Steven Rowe

        Issue Links

          Activity

            People

              siveton Siveton Vincent
              sarowe Steven Rowe
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: