It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Issues with Clover on maven parallel builds

Nathan Janken Aug 11, 2016

Does Clover support parallel builds for maven?  This is clover 4.1.1 (I just downloaded it today) and maven version info is:

mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_74, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.3", arch: "x86_64", family: "mac"

If I do: mvn -T 1C clean clover:setup test clover:aggregate clover:clover

I get various issues depending on the run such as:

  • Failed to execute goal com.atlassian.maven.plugins:clover-maven-plugin:4.1.1:setup (default-cli) on project woozle: Execution default-cli of goal com.atlassian.maven.plugins:clover-maven-plugin:4.1.1:setup failed. ConcurrentModificationException
  • Failed to execute goal com.atlassian.maven.plugins:clover-maven-plugin:4.1.1:setup (default-cli) on project woozle: Execution default-cli of goal com.atlassian.maven.plugins:clover-maven-plugin:4.1.1:setup failed. ArrayIndexOutOfBoundsException


     
A little more info with the maven debug flag turned on:
[ERROR] Failed to execute goal com.atlassian.maven.plugins:clover-maven-plugin:4.1.1:setup (default-cli) on project woozle: Execution default-cli of goal com.atlassian.maven.plugins:clover-maven-plugin:4.1.1:setup failed: 3 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.atlassian.maven.plugins:clover-maven-plugin:4.1.1:setup (default-cli) on project woozle: Execution default-cli of goal com.atlassian.maven.plugins:clover-maven-plugin:4.1.1:setup failed: 3
 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 default-cli of goal com.atlassian.maven.plugins:clover-maven-plugin:4.1.1:setup failed: 3
 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.lang.ArrayIndexOutOfBoundsException: 3
 at java.util.ArrayList.add(ArrayList.java:459)
 at org.apache.maven.model.BuildBase.addResource(BuildBase.java:94)
 at org.apache.maven.project.MavenProject.addResource(MavenProject.java:663)
 at com.atlassian.maven.plugin.clover.CloverInstrumentInternalMojo.injectGrover(CloverInstrumentInternalMojo.java:374)
 at com.atlassian.maven.plugin.clover.CloverInstrumentInternalMojo.execute(CloverInstrumentInternalMojo.java:311)
 at com.atlassian.maven.plugin.clover.CloverSetupMojo.execute(CloverSetupMojo.java:31)
 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
 ... 12 more
 

1 answer

0 votes
Marek Parfianowicz Atlassian Team Aug 11, 2016

Hi Nathan,

 

Clover does not support parallel compilation. So you can not use any of:

  • parallel build option in Maven,
  • <parallel> task in Ant or
  • parallel build in IDEA 12+ (Settings > Build > Compiler)

 

There are few technical issues which are blockers now:

  • locking the same database file by multiple threads/processes
  • parallel writing to the same database file
  • tracking per-test code coverage for tests executing in parallel

 

References:

 

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Opsgenie

Handling Opsgenie Alerts

Hi everyone, welcome to the kb articles for Opsgenie FAQs. I'm one of the Technical Support Engineers for Opsgenie who will be providing weekly posts on FAQs from customers.   All alerts are ...

63 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you