mojohaus / servicedocgen-maven-plugin

ServicedocGen Maven Plugin
Apache License 2.0
2 stars 4 forks source link

NPE in Analyzer(169) #23

Closed hohwille closed 3 years ago

hohwille commented 5 years ago
Caused by: java.lang.NullPointerException
    at org.codehaus.mojo.servicedocgen.Analyzer.<init> (Analyzer.java:169)
    at org.codehaus.mojo.servicedocgen.ServiceDocGenReport.executeReport (ServiceDocGenReport.java:178)
    at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:255)
    at org.apache.maven.reporting.AbstractMavenReport.execute (AbstractMavenReport.java:143)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)

https://github.com/mojohaus/servicedocgen-maven-plugin/blob/8b9c8bfd42132c65c5e66010c5d4b2c991ab368a/src/main/java/org/codehaus/mojo/servicedocgen/Analyzer.java#L169

hohwille commented 5 years ago

The only explanation for an NPE in Analyzer.java:169 is that this.descriptor is null and hence this.descriptor.getJavadocs() is failing. Therefore the ServicesDescriptor argument has to be null. This again comes from here: https://github.com/mojohaus/servicedocgen-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/servicedocgen/ServiceDocGenReport.java#L91 As required is false it might be possible to be null.

The error was caused from the commandline when invoking the plugin manually. I assume in that case the configuration from the reporting (or even pluginManagement) section does not apply. Still the plugin should give a reasonable error message or use meaningful defaults.

hohwille commented 3 years ago

Fixed.