Daniel Wegener created MLINKCHECK-26:
----------------------------------------

             Summary: Linkcheck does not support parrallel builds
                 Key: MLINKCHECK-26
                 URL: https://issues.apache.org/jira/browse/MLINKCHECK-26
             Project: Maven Linkcheck Plugin
          Issue Type: Bug
            Reporter: Daniel Wegener


Running multi-module-builds in parallel where multiple modules use the 
linkcheck plugin can trigger the following exception.

{code}
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-linkcheck-plugin:1.2:linkcheck (run-linkcheck) 
on project foo.documentation.arc: Execution run-linkcheck of goal 
org.apache.maven.plugins:maven-linkcheck-plugin:1.2:linkcheck failed. 
ConcurrentModificationException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal 
org.apache.maven.plugins:maven-linkcheck-plugin:1.2:linkcheck (run-linkcheck) 
on project foo.documentation.arc: Execution run-linkcheck of goal 
org.apache.maven.plugins:maven-linkcheck-plugin:1.2:linkcheck failed.
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at 
org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:185)
        at 
org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:181)
        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:1142)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution 
run-linkcheck of goal 
org.apache.maven.plugins:maven-linkcheck-plugin:1.2:linkcheck failed.
        at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
        at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 11 more
Caused by: java.util.ConcurrentModificationException
        at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1207)
        at java.util.TreeMap$KeyIterator.next(TreeMap.java:1261)
        at 
org.apache.maven.doxia.linkcheck.DefaultLinkCheck.check(DefaultLinkCheck.java:505)
        at 
org.apache.maven.doxia.linkcheck.DefaultLinkCheck.checkFile(DefaultLinkCheck.java:447)
        at 
org.apache.maven.doxia.linkcheck.DefaultLinkCheck.findAndCheckFiles(DefaultLinkCheck.java:423)
        at 
org.apache.maven.doxia.linkcheck.DefaultLinkCheck.execute(DefaultLinkCheck.java:232)
        at 
org.apache.maven.plugins.linkcheck.LinkcheckReport.executeLinkCheck(LinkcheckReport.java:430)
        at 
org.apache.maven.plugins.linkcheck.LinkcheckReport.execute(LinkcheckReport.java:285)
        at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        ... 12 more
{code}

Looks like the injected LinkCheck in 
https://github.com/apache/maven-plugins/blob/a3f8da79c8d050001524f7ea993c541bc4f79b0e/maven-linkcheck-plugin/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java#L74
 (which evaluates to a DefaultLinkCheck: 
https://github.com/apache/maven-doxia-tools/blob/doxia-tools-1.2/doxia-linkcheck/src/main/java/org/apache/maven/doxia/linkcheck/DefaultLinkCheck.java#L65)
 is not thread-safe.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to