I actually spent quite a bit of time trying to get this exact thing to work. The problem here is that you need the dependencies of jmockit to be on the surefire classpath when it's started up, but surefire provides no way to do this. I even tried creating my own jar with the jmockit classes and the dependency classes together so I could make that the javaagent jar, but that was unsuccessful as well.
I finally found a way to get my tests to work without jmockit. I was never able to get a javaagent to work with surefire. http://jira.codehaus.org/browse/SUREFIRE-298 is already present to address this issue (and it contains information about a workaround you can do in the meantime). ..David.. -----Original Message----- From: mikewilsonuk [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 01, 2007 7:41 AM To: [email protected] Subject: maven and jmockit, problem with -javaagent jvm arg Has anyone been able to get jmockit working with maven? jmockit needs the -javaagent command-line arg. I have specified the arg in <configuration><argLine>. It may be giving the arg to the jvm, but not the classpath as I immediately get a failure with "Exception in thread "main" java.lang.NoClassDefFoundError: org/objectweb/asm2/ClassVisitor". I can get this to work in 'ant' using <jvmarg value="-javaagent:/opt/jmockit/main/jmockit.jar" /> I must say I am beginning to regret the time spent learning maven and moving files around to suit its conventions: it seems to me to be too bureaucratic, unfinished and inflexible. -- View this message in context: http://www.nabble.com/maven-and-jmockit%2C-problem-with--javaagent-jvm-a rg-tf3675075s177.html#a10269204 Sent from the Maven - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
