Re: NoClassDefFoundError when running maven-exec-plugin and Cobertura

2010-11-17 Thread PaulGee

We had the same problem. Solution was to add cobertura dependency to the
instrumented component. So, just try adding 

 dependency
  groupIdnet.sourceforge.cobertura/groupId
  artifactIdcobertura/artifactId
  version1.9.4.1/version
/dependency

to your pom and try again. Make sure cobertura version is the same as the
one used by your version of cobertura plugin (in our case it was 2.4)


-- 
View this message in context: 
http://maven.40175.n5.nabble.com/NoClassDefFoundError-when-running-maven-exec-plugin-and-Cobertura-tp103455p3268700.html
Sent from the Maven - Users mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org



NoClassDefFoundError when running maven-exec-plugin and Cobertura

2008-03-18 Thread Thomas Larsson
Hi,

I have configured my reporting section with the cobertura plugin, version
2.0.
I also have a maven-exec-plugin defined to setup my testdatabase during the
test-compile phase as shown below:
(notice the classpath definition. If I understand this correctly, this
configuration should make all project dependencies appear on the classpath
during the maven execution, hmm, might be on to something here. anyway...)

  plugin
groupIdorg.codehaus.mojo/groupId
artifactIdexec-maven-plugin/artifactId
executions
!-- Test for the existence of the database --
execution
idtest-db-exists/id
phasetest-compile/phase
goals
goalexec/goal
/goals
configuration
executablejava/executable
arguments
argument-classpath/argument
classpath /
argument

blabla.blabla.blala.DatabaseAccessVerifier
/argument
/arguments
/configuration
/execution
   /executions
  /plugin


Now when I run mvn site, I get the following stacktrace (not complete
stacktrace)

[INFO] Instrumentation was successful.
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [exec:exec {execution: test-db-exists}]
[INFO] java.lang.NoClassDefFoundError:
net/sourceforge/cobertura/coveragedata/HasBeenInstrumented
[INFO]  at java.lang.ClassLoader.defineClass1(Native Method)
[INFO]  at java.lang.ClassLoader.defineClass(Unknown Source)
[INFO]  at java.security.SecureClassLoader.defineClass(Unknown Source)
[INFO]  at java.net.URLClassLoader.defineClass(Unknown Source)
[INFO]  at java.net.URLClassLoader.access$000(Unknown Source)
[INFO]  at java.net.URLClassLoader$1.run(Unknown Source)
[INFO]  at java.security.AccessController.doPrivileged(Native Method)
[INFO]  at java.net.URLClassLoader.findClass(Unknown Source)
[INFO]  at java.lang.ClassLoader.loadClass(Unknown Source)
[INFO]  at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
[INFO]  at java.lang.ClassLoader.loadClass(Unknown Source)
[INFO]  at java.lang.ClassLoader.loadClassInternal(Unknown Source)
[INFO] Caused by: java.lang.ClassNotFoundException:
net.sourceforge.cobertura.coveragedata.HasBeenInstrumented
[INFO]  at java.net.URLClassLoader$1.run(Unknown Source)
[INFO]  at java.security.AccessController.doPrivileged(Native Method)
[INFO]  at java.net.URLClassLoader.findClass(Unknown Source)
[INFO]  at java.lang.ClassLoader.loadClass(Unknown Source)
[INFO]  at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
[INFO]  at java.lang.ClassLoader.loadClass(Unknown Source)
[INFO]  at java.lang.ClassLoader.loadClassInternal(Unknown Source)
[INFO]  ... 12 more
[INFO] Exception in thread main
[INFO]

[ERROR] BUILD ERROR
[INFO]




Does anyone know how I can get the exec plugin to find the cobertura
classes?

Best Regards