I have a multi-module Maven setup with Java code.
My unit tests, in one of the modules, exercise code in multiple modules. Naturally, the modules have inter-dependenc
Never tried, but this may be a way to accomplish it:
mvn site
See cobertura documentation on how to manually invoke cobertura to instrument external JAR files in-place:
... You can also pass in jar files to be instrumented using standard ant filesets. Cobertura will extract each class from the jar and instrument it. If 'todir' was not specified then the original jar will be overwritten with an instrumented version ...
The pom.xml
's build plugins may look like this - you may want to add a profile or use classifiers to distinguish between the final jar file and the instrumented jar file if you don't want to overwrite them in your local repo. Then, in the tests module, you just need to define the dependencies to your other modules using the classifiers.
org.apache.maven.plugins
maven-antrun-plugin
cobertura-inplace-instrumentation
package
run
net.sourceforge.cobertura
cobertura
1.9.4.1