Tip for running Maven2 using Apache Harmony
Just set JAVA_HOME as usual and run “mvn clean install”. But there’s a gotcha. You may see the following issue when surefire tries to run the tests.
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 58 source files to /home/dims/XmlSchema/target/test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: /home/dims/XmlSchema/target/surefire-reports
Uncaught exception in main:
java.lang.ClassNotFoundException: org.apache.maven.surefire.booter.SurefireBooter
at java.net.URLClassLoader.findClass(URLClassLoader.java:894)
at java.lang.ClassLoader.loadClass(ClassLoader.java:593)
at java.lang.ClassLoader$SystemClassLoader.loadClass(ClassLoader.java:981)
at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
at org.apache.harmony.vm.JarRunner.main(JarRunner.java:72)
[INFO] ————————————————————————
[ERROR] BUILD FAILURE
[INFO] ————————————————————————
If you do, then just set your MAVEN_OPTS as follows and run “mvn clean install” again.
set MAVEN_OPTS=-Dsurefire.useSystemClassLoader=false
More information about this switch can be found at:
http://docs.codehaus.org/display/MAVENUSER/Classloading+and+Forking+under+Maven+Surefire
About this entry
You’re currently reading “Tip for running Maven2 using Apache Harmony,” an entry on Show me the code! - By Davanum Srinivas
- Published:
- 4.15.08 / 3pm
- Category:
- Uncategorized
- Tags:
1 Comment
Jump to comment form | comments rss [?] | trackback uri [?]