I have a maven plugin I would like to test against different Maven versions (Ex.: 2.2.1 & 3.0.4). Ideally I don’t want users running the build to have to install these exact versions manually.
Is it possible to install specific versions of Maven itself from Maven Central or some other source that would then cache them in the local Maven repo for subsequent builds?
Maven distributions are stored in Maven Central Repository, as you can see here:
Therefore, it can be used as a normal dependency with following coordinates:
tar.gz variant:
zip variant:
The rest is quite standard – you will probably use it in integration test poms, and call them with maven-invoker-plugin as recommended by @khmarbaise.