This is covered in the m-s-p documentation. http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html#jvm
Wayne On 1/25/07, Parikh, Pratik P. <[EMAIL PROTECTED]> wrote:
How do one configure surefire to use Java 6 for execution. Is there a way to do it in pom? Pratik -----Original Message----- From: Wayne Fay [mailto:[EMAIL PROTECTED] Sent: Thursday, January 25, 2007 2:00 PM To: Maven Users List Subject: Re: Surefire And Java6 You've only specified the maven-compiler-plugin should use Java6. Your problem occurs when Surefire attempts to use your default Java (in your case, Java4) to run the classes you compiled with Java6. Either configure Surefire to use Java6 when it executes, or change your Java home to Java6. Wayne On 1/25/07, Parikh, Pratik P. <[EMAIL PROTECTED]> wrote: > My java_home is set to Java 4, but in my pom I do specify that I want > to use java6. > > <plugin> > > <groupId>org.apache.maven.plugins</groupId> > > <artifactId>maven-compiler-plugin</artifactId> > <configuration> > <verbose>true</verbose> > <fork>true</fork> > > <executable>${jse6}\bin\javac</executable> > > <source>1.6</source> > <target>1.6</target> > <compilerArguments> > <verbose /> > <bootclasspath> > ${jse6}\jre\lib\rt.jar > </bootclasspath> > </compilerArguments> > </configuration> > </plugin> > > -----Original Message----- > From: Kalle Korhonen [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 25, 2007 11:52 AM > To: Maven Users List > Subject: Re: Surefire And Java6 > > You are compiling with 1.6 but running the classes in 1.5 (or 1.4). > what's > your JAVA_HOME set to? > > Kalle > > On 1/25/07, Parikh, Pratik P. <[EMAIL PROTECTED]> wrote: > > > > Hi Everyone, > > > > I am using Java6 and have some junit 3.8.1 test cases. When I > > try > to > > build I get following? > > > > I am using the 2.2 version of surefire? Is sun fire not > > supporting > in > > Java6 yet? If so is there a work around for this? > > > > <plugin> > > <artifactId>maven-surefire-plugin</artifactId> > > <version>2.2</version> > > </plugin> > > > > > > [INFO] Surefire report directory: > > C:\apparch\com.covance.infrastructure.core\target\surefire-reports > > org.apache.maven.surefire.booter.SurefireExecutionException: > > com/covance/system/core/util/CovanceServiceLoaderTestCase > > (Unsupported major.minor version 50.0); nested exception is > > java.lang.UnsupportedClassVersionError: > > com/cov/system/core/util/CovServiceLoaderTestCase (Unsupported > major.minor > > version 50.0) > > java.lang.UnsupportedClassVersionError: > > com/cov/system/core/util/CovServiceLoaderTestCase (Unsupported > major.minor > > version 50.0) > > at java.lang.ClassLoader.defineClass0(Native Method) > > at java.lang.ClassLoader.defineClass(ClassLoader.java:539) > > at > > > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123 > ) > > at > java.net.URLClassLoader.defineClass(URLClassLoader.java:251) > > at java.net.URLClassLoader.access$100(URLClassLoader.java:55) > > at java.net.URLClassLoader$1.run(URLClassLoader.java:194) > > at java.security.AccessController.doPrivileged(Native Method) > > at java.net.URLClassLoader.findClass(URLClassLoader.java:187) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:289) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:235) > > at > > org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass > > (IsolatedClass > > Loader.java:100) > > at > > > org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestS > et > s > > (Ab > > stractDirectoryTestSuite.java:84) > > at > > > org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire. > ja > va > > :1 > > 47) > > at org.apache.maven.surefire.Surefire.run(Surefire.java:108) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j > av > a > > :39 > > ) > > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke > > (DelegatingMethodAccessorImpl > > .java:25) > > at java.lang.reflect.Method.invoke(Method.java:324) > > at > > org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess > > (SurefireB > > ooter.java:225) > > at > > > org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.ja > va > > :747 > > ) > > > > Pratik Parikh > > > > > > > > ----------------------------------------------------- > > Confidentiality Notice: This e-mail transmission may contain > > confidential or legally privileged information that is intended only > > for the individual or entity named in the e-mail address. If you are > > not the intended recipient, you are hereby notified that any > > disclosure, copying, distribution, or reliance upon the contents of > > this e-mail is strictly prohibited. > > > > If you have received this e-mail transmission in error, please reply > > to the sender, so that we can arrange for proper delivery, and then > > please delete the message from your inbox. Thank you. > > > > > > > > --------------------------------------------------------------------- > 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] --------------------------------------------------------------------- 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]