Fork me on GitHub

For general information about Maven Toolchains, see Guide to Using Toolchains

Using Maven Toolchains with Surefire.

By default, if the pom configures the toolchains plugin as specified in the aforementioned guide, Surefire will launch the test jvm using the main toolchain configured in Maven.

In some cases, it may be desirable to compile and test using different jvms. While the jvm option can achieve this, it requires hardcoding system-specific paths. Configuration option jdkToolchain can be used to supply an alternate toolchain specification.

Configuring a different jvm for running tests using toolchains


The above example assumes that your toolchains.xml contains a valid entry with these values.