Clover can't instrument Groovy test classes due to java.io.NotSerializableException on creating ConfigDir

We have our maven build setup to run Groovy based integration tests. We want to be able to instrument our tests using distributed coverage while our app runs on a local jetty instance. This works great with Java based Junit tests but we are having trouble getting the Groovy tests instrumented.

When the build starts up with Clover the plugin throws the following stacktrace:

{code}

ERROR Could not create Clover Groovy configuration file. No Groovy instrumentation will occur. com.atlassian.maven.plugin.clover.DistributedCoverage

java.io.NotSerializableException: com.atlassian.maven.plugin.clover.DistributedCoverage

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)

at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)

at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)

at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)

at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)

at com.atlassian.clover.instr.java.InstrumentationConfig.saveToFile(InstrumentationConfig.java:429)

at com.atlassian.clover.ant.groovy.GroovycSupport.newConfigDir(GroovycSupport.java:360)

at com.atlassian.maven.plugin.clover.CloverInstrumentInternalMojo.injectGrover(CloverInstrumentInternalMojo.java:353)

at com.atlassian.maven.plugin.clover.CloverInstrumentInternalMojo.execute(CloverInstrumentInternalMojo.java:316)

at com.atlassian.maven.plugin.clover.CloverSetupMojo.execute(CloverSetupMojo.java:31)

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)

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:84)

at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)

at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)

at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)

at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)

at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)

at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)

at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)

at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

{code}

1 answer

Hi Dustin,

I've made a SNAPSHOT release of the Clover plugin for Maven2 that contains a candidate fix for this problem. To use it, you'll need to specify the snapshot version:

<plugin>

 <groupId>com.atlassian.maven.plugins</groupId>

 <artifactId>maven-clover2-plugin</artifactId>

 <version>3.1.3-SNAPSHOT</version>

</plugin>

Note that this snapshot version is only available from Atlassian's public snapshot repository, which you may need to add to your pom also:

<repositories>

        <repository>

          <id>atlassian-m2-snapshot-repository</id>

          <name>Atlassian Public Snapshot Repository</name>

          <url>https://maven.atlassian.com/public-snapshot</url>

        </repository>

</repositories>

Please let me know how you get on with this build.

Regards,

-Brendan

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published yesterday in Hipchat

Moving from Hipchat to Stride? Here’s what you’ll love

Heya, Hipchat friends! We’re so happy you’re checking out   Stride. Whether you know it or not, you have been instrumental in making Stride come to life. Every feature, design, and functionality...

59 views 2 6
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you