Show me the code! – By Davanum Srinivas

April 15, 2008

Tip for running Maven2 using Apache Harmony

Filed under: Uncategorized — Davanum Srinivas @ 3:33 pm

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.lang.ClassLoader.loadClass(
at java.lang.ClassLoader$SystemClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at org.apache.harmony.vm.JarRunner.main(
[INFO] ------------------------------------------------------------------------
[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:


1 Comment »

  1. Davanum,
    nice to see some online sign of life from you again.
    Hope you had a good start at big blue.


    Comment by Jörg Buchberger — April 17, 2008 @ 1:58 am

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at

%d bloggers like this: