Closed softwaremaverick closed 5 years ago
I have just released a new version 1.2.0 of the plugin that I had in the works for a while. I completely rewrote the concurrency part of the plugin. Can you please test if the problem still persists with Version 1.2.0?
I can sometimes get successes, but sometimes I get...
[ERROR] java.util.concurrent.ExecutionException: java.lang.NullPointerException
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder.multiThreadedProjectTaskSegmentBuild(MultiThreadedBuilder.java:173)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder.build(MultiThreadedBuilder.java:91)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
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:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder.multiThreadedProjectTaskSegmentBuild(MultiThreadedBuilder.java:165)
... 15 more
Caused by: java.lang.NullPointerException
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:188)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:184)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Any ideas?
I can see comments here indicating an NPE was fixed recently. I'm using Maven 3.2.5 which I cannot change.
FYI I'm currently running this plugin directly from the command line. mvn -threads 1C de.qaware.maven:go-offline-maven-plugin:1.2.0:resolve-dependencies
I have just had a successful run on Jenkins which I didn't on the earlier version and so I'm hoping that it can at least run reasonably reliably on Jenkins.
One thing to note is that the successes mentioned above on Jenkins are that I can now more reliably get successful executions of the plugin when using one thread. Previously on some branches I had failures even on single-threaded.
Did the previous version take a global thread setting? As on Jenkins previously I was passing the single thread parameter but it looked like when it failed there was a concurrent exception.
Version 1.1.0 had several problems that could lead to failed runs that had nothing to do with Thread settings fixed in 1.2.0. The the plugin beeing more stable on your Jenkins is a good sign that those fixes worked. Neither Version 1.1.0 nor Version 1.2.0 use the global thread setting from Maven in their internal code.
I have tried to recreate your issue and indeed when I use Maven 3.2.5 I sometimes get a NullPointerException. With Maven 3.5.4 I cannot recreate the issue.
Not sure why it happens yet, looking into it.
Unfortionatly, this seems to be an issue in maven core that was introduced in maven 3.1 and fixed in maven 3.5. According to the discussions in the related issue https://issues.apache.org/jira/browse/MNG-6170 this affects all aggregator plugins and there is nothing a plugin can do to solve the issue. You will have to upgrade (or downgrade) your maven.
Added documentation to alert users to this issue
I didn't explicitly specify parallel mode but I believe the slave may have had it configured in the M2 settings. Passing -threads 1 resolves the following issue.
It seems there was a ConcurrentModificationException encountered when running this plugin.
The useful stacktraces are as follows: