Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
Patch
Description
I discovered this NPE whilst running some integration tests for our Repoaint IO tiles-maven-plugin:
[INFO] Scanning for projects... [INFO] --- tiles-maven-plugin: Injecting 1 tiles as intermediary parent artifacts for com.test:reporting-tiletest... [INFO] Mixed 'com.test:reporting-tiletest:0.1.0' with tile 'com.test:reporting-tiletest-tile:0.1.0' as its new parent. [INFO] Mixed 'com.test:reporting-tiletest-tile:0.1.0' with original parent '(no parent)' as its new top level parent. [INFO] [ERROR] Internal error: java.lang.NullPointerException -> [Help 1] org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: java.lang.NullPointerException at org.apache.maven.model.plugin.DefaultReportingConverter.convert (DefaultReportingConverter.java:243) at org.apache.maven.model.plugin.DefaultReportingConverter.convert (DefaultReportingConverter.java:213) at org.apache.maven.model.plugin.DefaultReportingConverter.convertReporting (DefaultReportingConverter.java:140) at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:479) at org.apache.maven.model.building.DefaultModelBuilder.build (DefaultModelBuilder.java:432) at org.apache.maven.model.building.ModelBuilder$build$0.call (Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall (CallSiteArray.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call (AbstractCallSite.java:116) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call (AbstractCallSite.java:136) at io.repaint.maven.tiles.TilesMavenLifecycleParticipant.thunkModelBuilder (TilesMavenLifecycleParticipant.groovy:460) at io.repaint.maven.tiles.TilesMavenLifecycleParticipant.orchestrateMerge (TilesMavenLifecycleParticipant.groovy:362) at io.repaint.maven.tiles.TilesMavenLifecycleParticipant.afterProjectsRead (TilesMavenLifecycleParticipant.groovy:306) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
This was triggered when running our sitereporting test ( https://github.com/repaint-io/maven-tiles/tree/master/src/it/sitereporting-tiletest ) and doesn't trigger an NPE using Apache Maven 3.5.3, but does with the current SNAPSHOT of 3.6.2.
The problem lies when Maven is building the model from https://github.com/repaint-io/maven-tiles/blob/master/src/it/sitereporting-tiletest/tile-tile/tile.xml#L35 and can be fixed by applying the patch found at https://www.dropbox.com/s/9gficrmlgxl2jd0/0001-Fix-NPE-thrown-from-DefaultReportingConverter.patch?dl=0 (for some reason I could not attach the patch to the ticket).