Maven Plugin

What is the difference between mvn test and mvn baselinetest:test?

mvn test will execute the test phase of the build lifecycle and all phases that precede it.

mvn baselinetest:test will execute the test goal in the baselinetest plugin. This will not compile the test classes or execute any of the other phases of the build lifecycle.


How do I disable Surefire?

By default, Surefire will attempt to load any file matching **/Test*.java **/* **/* as a JUnit test. Since most baseline tests match this pattern, it is advisable to simply disable surefire if you have no Surefire tests. If necessary, the Surefire plugin can be enabled and configured to exclude certain names. See Surefire documentation for details.

Note that the Baseline Test Framework is not invoked via Surefire.


Why does mvn baselinetest:test not find the plugin?

mvn baselinetest:test

may cause the following error:

The plugin 'org.apache.maven.plugins:maven-baselinetest-plugin' does not exist or no valid version could be found

Edit your .m2/settings.xml file to include the following lines:



How can I reuse my test code in other modules?

Visit this link for your reference, Attaching tests


Specialized Testing

How do I disable baseline tests from the command line?

mvn test -Dbaselinetest.skip=true.


How do I execute specific tests on the command line?

mvn test -Dbaselinetest.contexts=MyContext -Dbaselinetest.suites=MySuite.

This will disable any contexts, suites, and vm settings from the pom.


How do I save a set of manual tests?

Use a build profile. See example for details.


How do I execute a series of tests in order?

Use additional test profiles. See example for details.