Search code examples
mavencoberturaactivejdbc

ActiveJDBC and Cobertura instrumentation


We want to use ActiveJDBC for database access. So far, everything works as expected after some minor hurdles with ActiveJDBC instrumentation in our IDEs.

However, we use Maven to build our projects and use Cobertura for reporting about code coverage in the Maven site build. It seems that ActiveJDBC instrumentation and Cobertura's code coverage instrumentation do not play together.

When building our Maven site, we get the following error during Cobertura's code coverage analysis:

Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:site (default-site) on project settings-core: 
failed to get report for org.codehaus.mojo:cobertura-maven-plugin: Failed to execute goal org.javalite:activejdbc-instrumentation:1.4.11:instrument (classes) on project settings-core: 
Failed to add output directory to classpath: 
org.javalite.instrumentation.InstrumentationException: java.lang.RuntimeException: <..>.Setting class is frozen -> [Help 1]

Is there any way to get those two to play together?


Solution

  • Cobertura uses bytecode instrumentation and so does ActiveJDBC, which can cause a conflict. In our experience, JaCoCo achieves the same goal and does not conflict with instrumentation: http://eclemma.org/jacoco/trunk/index.html