For projects that use Maven as the build system. This causes Jenkins to invoke Maven with the given goals and options. A non-zero exit code from Maven makes Jenkins mark the build as a failure. Some Maven versions have a bug where it doesn't return the exit code correctly.

Jenkins passes various environment variables to Maven, which you can access from Maven as "${env.VARIABLENAME}".

The same variables can be used in command-line arguments (as if you are invoking this from shell). For example, you can specify -DresultsFile=${WORKSPACE}/${BUILD_TAG}.results.txt