Maven Core Integration Tests Suite

This module provides the effective Core Integration Tests suite, starting with bootstrap.

Running the Core ITs

By default, the project just packages the tests in an artifact. To actually run them, activate the run-its profile:

mvn clean test -Prun-its

This will subject the Maven version running the build to the integration tests.

If you would like to test a different Maven distribution, you can use the mavenHome system property to specify the path of the Maven distribution to test:

mvn clean test -Prun-its -DmavenHome=<maven-under-test>

Alternatively, you can just specify the version of a previously installed/deployed Maven distribution which will be downloaded, unpacked and tested:

mvn clean test -Prun-its -DmavenVersion=2.2.1

To run the ITs using embedded Maven 3.x, additionally activate the embedded profile.

ITs that don't require to fork Maven can also be run from the IDE using the Maven projects from the workspace if the Maven dependencies are added to the test class path.

If you're behind a proxy, use the system properties, proxy.port, proxy.user, proxy.pass and proxy.nonProxyHosts to specify the required proxy setup for the ITs. Alternatively, set the system property to a URL of a local repository manager (anonymous authentication only) that proxies the required artifacts.

Core ITs Suite Results

ITs results are displayed on the console and can be published in the site through Surefire Report.

mvn -Preporting site

Currently deployed Surefire Report was generated with following environment:

maven.version: 3.6.2
java.version: 1.7.0_161 Linux
os.version: 5.0.0-25-generic

Core ITs and dependencies

A good IT does not depend on external repos like Central, it uses dedicated test plugins and test repositories. The default settings.xml used by ITs helps to enforce this by pointing central at file:target/null, which obviously can't resolve anything. This setup using a file-based dummy repo also helps execution time, because this repo produces (expected) 404s much faster than a HTTP-based repo.

The one place where access to Central is desired is in the MavenITBootstrapTest (src, javadoc), which doesn't really test anything but just primes the local repo with any artifacts the ITs will need: you can see here the list of plugins and artifacts that are fetched during bootstrap.

So some care needs to be taken when introducing new dependencies into the ITs themselves or the support plugins. Many times the failures that we encounter are discrepancies between actual artifact consumption required and what is populated during bootstrapping. When forgetting, typical failures (as seen in ASF CI) will give following traces in log:

[INFO] Downloading from central: file:target/null/...
[ERROR] Failed to execute goal ... (...) on project ...: ... Could not find artifact ... in central (file:target/null) -> [Help 1]