[ https://issues.apache.org/jira/browse/MSHARED-1050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17514951#comment-17514951 ]
Karl Heinz Marbaise commented on MSHARED-1050: ---------------------------------------------- First recommendation is to upgrade maven-resources-plugin to the most recent one 3.2.0... > ConcurrentModificationException for maven-filtering > ---------------------------------------------------- > > Key: MSHARED-1050 > URL: https://issues.apache.org/jira/browse/MSHARED-1050 > Project: Maven Shared Components > Issue Type: Bug > Components: maven-filtering > Reporter: Ladislav Lencucha > Priority: Major > > Maven filtering is not thread safe. Adding all properties from request maven > session results in ConcurrentModificationException. > Problem is line 117 (and possibly also 118): > [https://github.com/apache/maven-filtering/blob/maven-filtering-3.1.1/src/main/java/org/apache/maven/shared/filtering/BaseFilter.java] > *How to simulate:* > # use maven-resources-plugin which relies on maven-filtering > ## maven-resources-plugin version 3.1.0 > ## maven-filtering version 3.1.1 > # have multithreaded build (e.g. mvn package -T 48) > # problem does not happen all the time, but more threads improve the chances > *JDK* > Oracle JDK 1.8 > *Possible cause:* > I have no clue, everything seems to be synchronized. Maybe the collection is > being added to itself and that is why synchronized set wrapper did not work? > *Sample stacktrace of failed build:* > {code:java} > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal org.apache.maven.plugins:maven-resources-plugin:3.1.0:resources > (default-resources) on project sample-projct: Execution default-resources of > goal org.apache.maven.plugins:maven-resources-plugin:3.1.0:resources failed. > 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:196) > at > org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call > (MultiThreadedBuilder.java:186) > 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) > Caused by: org.apache.maven.plugin.PluginExecutionException: Execution > default-resources of goal > org.apache.maven.plugins:maven-resources-plugin:3.1.0:resources failed. > at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo > (DefaultBuildPluginManager.java:148) > 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:196) > at > org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call > (MultiThreadedBuilder.java:186) > 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) > Caused by: java.util.ConcurrentModificationException > at java.util.Hashtable$Enumerator.next (Hashtable.java:1387) > at java.util.Hashtable.putAll (Hashtable.java:523) > at org.apache.maven.shared.filtering.BaseFilter.getDefaultFilterWrappers > (BaseFilter.java:117) > at > org.apache.maven.shared.filtering.DefaultMavenFileFilter.getDefaultFilterWrappers > (DefaultMavenFileFilter.java:53) > at > org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.handleDefaultFilterWrappers > (DefaultMavenResourcesFiltering.java:269) > at > org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources > (DefaultMavenResourcesFiltering.java:132) > at org.apache.maven.plugins.resources.ResourcesMojo.execute > (ResourcesMojo.java:345) > 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:196) > at > org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call > (MultiThreadedBuilder.java:186) > 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){code} -- This message was sent by Atlassian Jira (v8.20.1#820001)