I'm not sure we have been using jMockit both on the CLI and m2eclipse (with configuration).. Remove the "quotes" in argLine maybe? For m2eclipse, just open the dialog create a new TestNG configuration and enter the argline in the One of the tabs (I don't remember which one, I don't have access to my eclipse)
Thanks, mohan kr -----Original Message----- From: Reinhard Nägele [mailto:reinhard.naeg...@mgm-tp.com] Sent: Thursday, March 12, 2009 8:33 AM To: user@m2eclipse.codehaus.org Subject: RE: [m2eclipse-user] Error using javaagent in Surefire plugin Thanks for coming up with this workaround. The issue is not really a big deal for us because it works from the command line and also using a different Maven installation in m2eclipse. Inside Eclipse we usually use the TestNG plugin anyways. My question now is: Is this a bug in m2eclipse or a Maven issue? Should I create a JIRA ticket? As mentioned, the problem does not show up with Maven 2.0.10 or 2.1-RC2 (neither externally nor withing m2eclipse), but with the embedded 2.1-SNAPSHOT only. Reinhard -----Original Message----- From: stug23 [mailto:pat.poden...@gmail.com] Sent: Wednesday, March 11, 2009 5:05 PM To: user@m2eclipse.codehaus.org Subject: Re: [m2eclipse-user] Error using javaagent in Surefire plugin There is a workaround that doesn't require m2eclipse to resolve settings properties (although it most certainly should) that I found to work quite nicely: <http://openejb.apache.org/3.0/javaagent-with-maven-surefire.html> Reinhard Nägele wrote: > > Hello, > > We use JMockit and TestNG for unit tests. The Surefire plugin is > configured as follows: > > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-surefire-plugin</artifactId> > <version>2.4.3</version> > <configuration> > > <argLine>-javaagent:"${settings.localRepository}/jmockit/jmockit/{jmockit.ve rsion}/jmockit-${jmockit.version}.jar"</argLine> > </configuration> > </plugin> > > Using the embedded Maven installation of m2eclipse > (0.9.7.200811301806), we get an error. From the console output it > seems that ${settings.localRepository} is not replaced, but > ${jmockit.version} actually is. The problem does not show up with > Maven 2.0.10 and 2.1.0-M1 (neither externally nor withing m2eclipse). > > Reinhard > > > [DEBUG] Using JVM: C:\Java\jdk1.5.0_16\jre\bin\java [INFO] Surefire > report directory: <...> Forking command line: cmd.exe /X /C > "C:\Java\jdk1.5.0_16\jre\bin\java > -javaagent:${settings.localRepository}/jmockit/jmockit/0.94/jmockit-0. > 94.jar -jar C:\DOKUME~1\rnaegele\LOKALE~1\Temp\surefirebooter28747.jar > C:\DOKUME~1\rnaegele\LOKALE~1\Temp\surefire28745tmp > C:\DOKUME~1\rnaegele\LOKALE~1\Temp\surefire28746tmp" > Error occurred during initialization of VM agent library failed to > init: instrument Error opening zip file: > ${settings.localRepository}/jmockit/jmockit/0.94/jmockit-0.94.jar > [DEBUG] disposing managed ClassRealm with id: > /plugins/org.apache.maven.plugins:maven-surefire-plugin:2....@48/threa > d:main [DEBUG] dissociating all components from managed ClassRealm > with id: > /plugins/org.apache.maven.plugins:maven-surefire-plugin:2....@48/threa > d:main [DEBUG] disposing managed ClassRealm with id: > /plugins/org.apache.maven.plugins:maven-compiler-plugin:2....@48/threa > d:main [DEBUG] dissociating all components from managed ClassRealm > with id: > /plugins/org.apache.maven.plugins:maven-compiler-plugin:2....@48/threa > d:main [DEBUG] disposing managed ClassRealm with id: > /projects/<...>/thread:main [DEBUG] dissociating all components from > managed ClassRealm with id: > /projects/<...>/thread:main > [DEBUG] disposing managed ClassRealm with id: > /plugins/org.apache.maven.plugins:maven-resources-plugin:2...@48/thread > :main [DEBUG] dissociating all components from managed ClassRealm with > id: > /plugins/org.apache.maven.plugins:maven-resources-plugin:2...@48/thread > :main [DEBUG] disposing managed ClassRealm with id: > /extensions/org.apache.maven.wagon:wagon-webdav:1.0-beta-2/thread:main > [DEBUG] dissociating all components from managed ClassRealm with id: > /extensions/org.apache.maven.wagon:wagon-webdav:1.0-beta-2/thread:main > [ERROR] > > Mojo: > > org.apache.maven.plugins:maven-surefire-plugin:2.4.3:test > > FAILED for project: > > <...> > > Reason: > > There are test failures. > > Please refer to <...> for the individual test results. > > > > > > Error stacktrace: > org.apache.maven.ProjectBuildFailureException: Build for project: > <...> failed during execution of mojo: > org.apache.maven.plugins:maven-surefire-plugin:2.4.3:test > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForPro ject(DefaultLifecycleExecutor.java:293) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa ultLifecycleExecutor.java:191) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle Executor.java:149) > at > org.apache.maven.DefaultMaven.execute_aroundBody0(DefaultMaven.java:223) > at > org.apache.maven.DefaultMaven.execute_aroundBody1$advice(DefaultMaven.java:3 04) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:1) > at > org.apache.maven.embedder.MavenEmbedder.execute_aroundBody2(MavenEmbedder.ja va:904) > at > org.apache.maven.embedder.MavenEmbedder.execute_aroundBody3$advice(MavenEmbe dder.java:304) > at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:1) > at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:176) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:63) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at > org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.ja va:289) > at > org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) > at > org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher. java:408) > at > org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:351) > at org.codehaus.classworlds.Launcher.main(Launcher.java:31) > Caused by: org.apache.maven.plugin.MojoFailureException: There are > test failures. > > Please refer to <...> for the individual test results. > at > org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java: 575) > at > org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage r.java:579) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail ures(DefaultLifecycleExecutor.java:498) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmentForPro ject(DefaultLifecycleExecutor.java:265) > ... 19 more > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > > -- View this message in context: http://www.nabble.com/Error-using-javaagent-in-Surefire-plugin-tp22429241p22 458377.html Sent from the Maven Eclipse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email