Maven Javadoc Plugin
  1. Maven Javadoc Plugin
  2. MJAVADOC-251

Configuration of javadoc:javadoc fails with NPE upon disadvantageous order of config injection

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6.1
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Compare these two logs from Maven 3.x

      [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-javadoc-plugin:2.5:javadoc' with basic configurator -->
      [DEBUG]   (f) nosince = false
      [DEBUG]   (f) use = true
      [DEBUG]   (f) bootclasspathArtifacts = []
      [DEBUG]   (f) links = []
      [DEBUG]   (f) encoding = UTF-8
      [DEBUG]   (f) aggregate = false
      [DEBUG]   (f) tags = []
      [DEBUG]   (f) isOffline = false
      [DEBUG]   (f) useStandardDocletOptions = true
      [DEBUG]   (f) taglets = []
      [DEBUG]   (f) doctitle = Maven Ant Plugin 2.3-SNAPSHOT API
      [DEBUG]   (f) resourcesArtifacts = []
      [DEBUG]   (s) reportOutputDirectory = M:\maven\plugins\maven-ant-plugin\target\site\apidocs
      Unable to parse the created DOM for plugin configuration
      org.apache.maven.plugin.PluginConfigurationException: Unable to parse the created DOM for plugin configuration
              at org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:611)
              at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:564)
              at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:336)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:281)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:208)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:181)
              at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:467)
              at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:163)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:56)
              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:597)
              at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
              at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
              at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:408)
              at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351)
      Caused by: org.codehaus.plexus.component.configurator.ComponentConfigurationException:
      Setter
        org.apache.maven.plugin.javadoc.JavadocReport.setReportOutputDirectory( java.lang.Class )
      threw exception when called with parameter 'M:\maven\plugins\maven-ant-plugin\target\site\apidocs': null
              at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.setValueUsingSetter(ComponentValueSetter.java:204)
              at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:225)
              at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:140)
              at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:58)
              at org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:605)
              ... 16 more
      Caused by: java.lang.reflect.InvocationTargetException
              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:597)
              at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.setValueUsingSetter(ComponentValueSetter.java:191)
              ... 20 more
      Caused by: java.lang.NullPointerException
              at java.lang.String.endsWith(String.java:1466)
              at org.apache.maven.plugin.javadoc.JavadocReport.setReportOutputDirectory(JavadocReport.java:184)
              ... 25 more
      

      and from Maven 2.2.x

      [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-javadoc-plugin:2.5:javadoc' -->
      [DEBUG]   (f) aggregate = false
      [DEBUG]   (f) author = true
      [DEBUG]   (f) bootclasspathArtifacts = []
      [DEBUG]   (f) bottom = Copyright © {inceptionYear}-{currentYear} {organizationName}. All Rights Reserved.
      [DEBUG]   (f) breakiterator = false
      [DEBUG]   (f) debug = false
      [DEBUG]   (f) destDir = apidocs
      [DEBUG]   (f) docfilessubdirs = false
      [DEBUG]   (f) docletArtifact = groupId = 'null'artifactId = 'null'version = 'null'
      [DEBUG]   (f) docletArtifacts = []
      [DEBUG]   (f) doctitle = Maven Ant Plugin 2.3-SNAPSHOT API
      [DEBUG]   (f) encoding = UTF-8
      [DEBUG]   (f) failOnError = true
      [DEBUG]   (f) groups = []
      [DEBUG]   (f) isOffline = false
      [DEBUG]   (f) javadocDirectory = M:\maven\plugins\maven-ant-plugin\src\main\javadoc
      [DEBUG]   (f) keywords = false
      [DEBUG]   (f) links = []
      [DEBUG]   (f) linksource = false
      [DEBUG]   (f) localRepository = Repository[local|file://U:\Jeder\Maven-2]
      [DEBUG]   (f) nocomment = false
      [DEBUG]   (f) nodeprecated = false
      [DEBUG]   (f) nodeprecatedlist = false
      [DEBUG]   (f) nohelp = false
      [DEBUG]   (f) noindex = false
      [DEBUG]   (f) nonavbar = false
      [DEBUG]   (f) nooverview = false
      [DEBUG]   (f) nosince = false
      [DEBUG]   (f) notimestamp = false
      [DEBUG]   (f) notree = false
      [DEBUG]   (f) offlineLinks = []
      [DEBUG]   (f) old = false
      [DEBUG]   (f) outputDirectory = M:\maven\plugins\maven-ant-plugin\target\apidocs
      [DEBUG]   (f) overview = M:\maven\plugins\maven-ant-plugin\src\main\javadoc\overview.html
      [DEBUG]   (f) project = MavenProject: org.apache.maven.plugins:maven-ant-plugin:2.3-SNAPSHOT @ M:\maven\plugins\maven-ant-plugin\pom.xml
      [DEBUG]   (f) quiet = false
      [DEBUG]   (f) reactorProjects = [MavenProject: org.apache.maven.plugins:maven-ant-plugin:2.3-SNAPSHOT @ M:\maven\plugins\maven-ant-plugin\pom.xml]
      [DEBUG]   (f) remoteRepositories = [Repository[apache.snapshots|http://repository.apache.org/snapshots], Repository[central|http://repo1.maven.org/maven2]]
      [DEBUG]   (s) reportOutputDirectory = M:\maven\plugins\maven-ant-plugin\target\site\apidocs
      [DEBUG]   (f) resourcesArtifacts = []
      [DEBUG]   (f) serialwarn = false
      [DEBUG]   (f) session = org.apache.maven.execution.MavenSession@272961
      [DEBUG]   (f) settings = org.apache.maven.settings.Settings@1c0b8a0
      [DEBUG]   (f) show = protected
      [DEBUG]   (f) skip = false
      [DEBUG]   (f) splitindex = false
      [DEBUG]   (f) stylesheet = java
      [DEBUG]   (f) tagletArtifact = groupId = 'null'artifactId = 'null'version = 'null'
      [DEBUG]   (f) tagletArtifacts = []
      [DEBUG]   (f) taglets = []
      [DEBUG]   (f) tags = []
      [DEBUG]   (f) use = true
      [DEBUG]   (f) useStandardDocletOptions = true
      [DEBUG]   (f) verbose = false
      [DEBUG]   (f) version = true
      [DEBUG]   (f) windowtitle = Maven Ant Plugin 2.3-SNAPSHOT API
      [DEBUG] -- end configuration --
      

      Note the different order in which the parameter values are injected. When reportOutputDirectory is injected before destDir, the mojo produces the NPE.

      The plugin should not rely on any particular ordering of the parameters.

        Issue Links

          Activity

          Hide
          Benjamin Bentmann added a comment -

          Fixed in r800618.

          Show
          Benjamin Bentmann added a comment - Fixed in r800618 .

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Benjamin Bentmann
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: