Page 1 of 1

Problems with cobertura

Posted: Mon Oct 12, 2009 2:40 am
by diablo
Exception occurs when building the all project by calling "mvn install".
Here is the log:
[cobertura-instrument] java.lang.NoClassDefFoundError: net/sourceforge/cobertura/instrument/Main
[cobertura-instrument] Caused by: java.lang.ClassNotFoundException: net.sourceforge.cobertura.instrument.Main
[cobertura-instrument] at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
[cobertura-instrument] at java.security.AccessController.doPrivileged(Native Method)
[cobertura-instrument] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
[cobertura-instrument] at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
[cobertura-instrument] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[cobertura-instrument] at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
[cobertura-instrument] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
[cobertura-instrument] Could not find the main class: net.sourceforge.cobertura.instrument.Main. Program will exit.
[cobertura-instrument] Exception in thread "main"

My maven version is 2.2.1. Did it work well with cobertura plugin?

Re: Problems with cobertura

Posted: Mon Oct 12, 2009 9:11 am
by bradford.taylor
Thank you for your inquiry.

What version of the code are you running maven install on? Is it the latest from sourceforge subversion or 1.0.0 from the zip file?

Bradford Taylor

Re: Problems with cobertura

Posted: Thu Oct 15, 2009 5:14 am
by slp
Hi, I have exactly the same problem here.
maven version 2.2.1
broadleaf code is 1.0.0 from the zip file.

Any suggestion? Thank's

Said.

Re: Problems with cobertura

Posted: Thu Oct 15, 2009 8:46 am
by bradford.taylor
It appears that Maven is not successfully retrieving the Cobertura dependency. We have tested this with maven 2.2.1 and the build succeeded. Could you try clearing out your maven cache and re-running the build?

Re: Problems with cobertura

Posted: Thu Oct 15, 2009 2:25 pm
by slp
I might look a bit clumsy here, but I'm no maven expert. How do I clear its cache?

Re: Problems with cobertura

Posted: Thu Oct 15, 2009 4:52 pm
by bradford.taylor
On Windows maven puts the repository in c:\documents and settings\{username}\.m2. On a Mac or unix you can find the Maven repository under ~/.m2.To clear the cache you simply delete this directory.

Re: Problems with cobertura

Posted: Fri Oct 16, 2009 7:11 am
by slp
Thank you for being so reactive Bradford.
Bad luck: I erased maven's cache directory from my hard disk and went for another mvn install... and got exactly the same error regarding cobertura.
Any other idea?
Otherwise, it's just a code coverage tool after all, and should not be critical to build the application? Any way to get rid of it?

Said.

Re: Problems with cobertura

Posted: Mon Oct 19, 2009 12:24 pm
by jefffischer
I've added configuration to the project that will now allow cobertura to be skipped whenever tests are skipped during the maven install. This change has been included in trunk and the 1.0.x branch. Therefore, to be able to try it out, you will have to get the latest source from the 1.0.x branch and execute the following command "mvn -Dmaven.test.skip=true install" instead of the standard "mvn install" command.

Re: Problems with cobertura

Posted: Tue Oct 20, 2009 11:43 am
by slp
I skipped the tests and it solved the problem, thank you.
I'm facing a new one, so I'll start a new thread