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>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<!-- Test for the existence of the database -->
<execution>
<id>test-db-exists</id>
<phase>test-compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>java</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