Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

How to direct test output to the console

By default, test output goes to target/surefire-reports/. If you'd like to see it on the console, add

Code Block

to the command line.

To make this permanent, configure the Surefire plugin as follows:

No Format

Or to set the properties without configuring the plugin use global property names:

No Format

if you want to set the reportFormat it's global property name is surefire.reportFormat

How to skip all tests by default

Put this in your settings.xml:

No Format
     <!-- skip tests by default, but allow override on command line -->

This will set maven.test.skip to true, as long as you don't set it on
the command line. The nice part about this technique is that it DOES
allow you to override it on the command line if you want to.

Surefire and the System Classloader

However you run Surefire (forked or not, with child delegation or not), the system classloader will not contain your test code. In
forked mode, it will only contain surefire and your testing framework. Surefire itself will create an isolated classloader that contains your
test code and its dependencies and run your tests from that classloader.

If you expect your code to work in anything but a basic Java application, do not depend on the system classloader.