cobertura-maven-plugin with "non-java packaging"

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

cobertura-maven-plugin with "non-java packaging"

Halvor Platou-2

Hello

 

I have a maven project with a non-java packaging type(jni), but with specific configuration of maven-compiler-plugin and maven-surefire-plugin to compile and test java source.

 

During instrumentation I get this message:

“Not executing cobertura:instrument as the project is not a Java classpath-capable package”

 

This seems to bypass the whole copying of classes to “generated-classes”, but the test goal is still run giving an error if there in fact are any tests:

testApp(x.y.z.coberturatest.AppTest)  Time elapsed: 0.006 sec  <<< ERROR!

java.lang.NoClassDefFoundError: x/y/z/coberturatest/App

 

It seems that there is an inconsistency here:

instrumentation is skipped when artifactHandler.getLanguage() != “java”, but test is still run – referring to “generated-classes”

 

My hope is that the plugin could do some better checking of whether or not there are any generated java-classes, but if not, it would at least be better to also skip the test-goal. Or maybe there is a good reason for it to be this way?

 

 

Included a simple test project (using packaging pom and forceMojoExecution=true) to demonstrate the problem.

 


Halvor Platou
R&D Manager CyberSea Technology
Marine Cybernetics
Vestre Rosten 77, Trondheim, Norway
www.marinecyb.com

 



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

cobertura-test.zip (5K) Download Attachment