Thanks. Using either of your suggestions leads to this stacktrace:
java.lang.ClassNotFoundException:
com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at
org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
at
org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
at
org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
at
org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
at
org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at
com.temboo.arcturus.maven_testsuite_plugin.TestsuitePlugin.execute(TestsuitePlugin.java:44)
Thanks for everyone's help on this!
Monty
---- Original Message ----
From: Marcel Schutte <[EMAIL PROTECTED]>
To: Maven Users List <[email protected]>
Sent: Tuesday, May 15, 2007 12:11:30 AM
Subject: Re: classpath clarification
Hi Monty,
You shouldn't use ClassLoader.getSystemClassLoader() to lookup your class.
Maven uses a hierarchy of classloaders and by specifying that you want the
systemclassloader, you bypass this completely. Instead, try with
'Class.forName("com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest")'
or
'Thread.currentThread().getContextClassLoader().loadClass("com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest")'.
A similar reasoning holds for System.getProperty("java.class.path"). Once you
have a Class instance 'clazz' you can use
'clazz.getProtectionDomain().getCodeSource().getLocation()' instead.
Regards,
Marcel
----- Original Message ----
From: Monty Zukowski <[EMAIL PROTECTED]>
To: Maven Users List <[email protected]>
Sent: Monday, May 14, 2007 11:29:46 PM
Subject: Re: classpath clarification
From: Wayne Fay <[EMAIL PROTECTED]>
> You need to tag your mojo with:
> @requiresDependencyResolution test
> Read more here:
> http://maven.apache.org/developers/mojo-api-specification.html
That didn't seem to help:
/**
* @goal testsuite
* @description Will run a testsuite
* @requiresDependencyResolution test
* @phase test
*/
public class TestsuitePlugin
extends AbstractMojo
{
/**
* @parameter expression="${project}"
* @required
*/
private MavenProject project;
public void execute()
throws MojoExecutionException
{
String classpath = System.getProperty("java.class.path");
getLog().info("classpath: " + classpath);
try {
ClassLoader.getSystemClassLoader().loadClass("com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest");
getLog().info("got the class!");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
Gives:
[INFO] [arcturustestsuite:testsuite {execution: 1}]
[INFO] classpath:
/usr/local/maven-2.0.4/core/boot/classworlds-1.1.jar:/usr/lib/j2sdk1.5-sun//lib/tools.jar
java.lang.ClassNotFoundException:
com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest
I assume I should see target/test-classes and friends in the classpath. When I
try to load the class I want to run, it fails saying it's not on the classpath.
Thanks again,
Monty
____________________________________________________________________________________
Get your own web address.
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]