JVM forked during tests does not use "java.home"
------------------------------------------------

                 Key: MSUREFIRE-154
                 URL: http://jira.codehaus.org/browse/MSUREFIRE-154
             Project: Maven 2.x Surefire Plugin
          Issue Type: Bug
         Environment: Ubuntu Dapper, Sun JDKs (many versions), Maven 2.0.4
            Reporter: Simone Bordet 


Maven script "mvn" uses JAVA_HOME to figure out the JDK. However, when running 
the tests, Maven forks the JVM just using the "java" command. Most of the 
times, the "java" interpreter in the PATH is not the one used for the build or 
referenced by JAVA_HOME (in Linux distros, it often points to GNU ClassPath).
Normally, the JDK used for the build is also the JDK one wants to run the tests.
I am suggesting that the forked JVM for the tests should use the "java.home" 
system property of the JVM used for the build, and then append "java" and all 
the classpath of the tests.
I think this will be most useful to people that develops using different JDKs.

Maven 2.0.4 excerpt:
> mvn -X
...
[INFO] Surefire report directory: 
/home/simon/opensource/maven/target/surefire-reports
Forking command line: java -classpath 
/home/simon/.m2/repository/org/apache/maven/surefire/surefire-api/2.0/surefire-api-2.0.jar:/home/simon/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar:/home/simon/.m2/repository/org/apache/maven/surefire/surefire-booter/2.0/surefire-booter-2.0.jar
 org.apache.maven.surefire.booter.SurefireBooter /tmp/surefire58883tmp 
/tmp/surefire58884tmp
...

The above should read, after "Forking command line:", if 
JAVA_HOME=/usr/local/jdk150:

/usr/local/jdk150/bin/java -classpath ...


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to