You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I observed the following build failure, after many successful executions of the add-third-party goal in various large (concurrent) Maven builds:
[ERROR] Failed to execute goal org.codehaus.mojo:license-maven-plugin:2.0.0:add-third-party (check-third-party-licenses) on project some-internal-project: could not init goal AddThirdPartyMojo for reason : null: ConcurrentModificationException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:license-maven-plugin:2.0.0:add-third-party (check-third-party-licenses) on project some-internal-project: could not init goal AddThirdPartyMojo for reason : null
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:190)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
at java.util.concurrent.FutureTask.run (FutureTask.java:264)
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
at java.util.concurrent.FutureTask.run (FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
at java.lang.Thread.run (Thread.java:834)
Caused by: org.apache.maven.plugin.MojoExecutionException: could not init goal AddThirdPartyMojo for reason : null
at org.codehaus.mojo.license.AbstractLicenseMojo.execute (AbstractLicenseMojo.java:185)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:190)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
at java.util.concurrent.FutureTask.run (FutureTask.java:264)
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
at java.util.concurrent.FutureTask.run (FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
at java.lang.Thread.run (Thread.java:834)
Caused by: java.util.ConcurrentModificationException
at java.util.TreeMap$PrivateEntryIterator.nextEntry (TreeMap.java:1208)
at java.util.TreeMap$EntryIterator.next (TreeMap.java:1244)
at java.util.TreeMap$EntryIterator.next (TreeMap.java:1239)
at java.util.TreeMap.buildFromSorted (TreeMap.java:2554)
at java.util.TreeMap.buildFromSorted (TreeMap.java:2578)
at java.util.TreeMap.buildFromSorted (TreeMap.java:2546)
at java.util.TreeMap.buildFromSorted (TreeMap.java:2578)
at java.util.TreeMap.buildFromSorted (TreeMap.java:2546)
at java.util.TreeMap.buildFromSorted (TreeMap.java:2503)
at java.util.TreeMap.putAll (TreeMap.java:318)
at org.codehaus.mojo.license.api.DependenciesTool.loadProjectDependencies (DependenciesTool.java:120)
at org.codehaus.mojo.license.api.DefaultThirdPartyHelper.loadDependencies (DefaultThirdPartyHelper.java:152)
at org.codehaus.mojo.license.AddThirdPartyMojo.loadDependencies (AddThirdPartyMojo.java:226)
at org.codehaus.mojo.license.AbstractAddThirdPartyMojo.init (AbstractAddThirdPartyMojo.java:750)
at org.codehaus.mojo.license.AbstractLicenseMojo.execute (AbstractLicenseMojo.java:171)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:190)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
at java.util.concurrent.FutureTask.run (FutureTask.java:264)
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
at java.util.concurrent.FutureTask.run (FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
at java.lang.Thread.run (Thread.java:834)
The issue is that DefaultThirdPartyHelper#artifactCache is shared between (and updated by) multiple threads without sufficient synchronization. I'll open a PR with a suggested fix.
The text was updated successfully, but these errors were encountered:
@bjanczak there's a PR for this issue (#355), but this plugin does not appear to be actively maintained 😞 . We're also still hitting this issue frequently.
Can one of the maintainers please have a look at this ☝️ PR? It's a very tiny fix.
Today I observed the following build failure, after many successful executions of the
add-third-party
goal in various large (concurrent) Maven builds:The issue is that
DefaultThirdPartyHelper#artifactCache
is shared between (and updated by) multiple threads without sufficient synchronization. I'll open a PR with a suggested fix.The text was updated successfully, but these errors were encountered: