Add support for Maven Toolchain Plugin

The Maven compiler plugin now supports multiple JDK’s via their toolchain plugin, more information may be found here https://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html IMHO Toolchains would be an outstanding feature to add to TravisCI, in general.

Our project requires the plugin due to changes in our build process.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:3.0.0:toolchain (default) on project red5-io: Cannot find matching toolchain definitions for the following toolchain types:
[ERROR] jdk [ version='[1.11,)' ]
[ERROR] Please make sure you define the required toolchains in your ~/.m2/toolchains.xml file.

Failing build: https://travis-ci.org/Red5/red5-io

I understand that this has been requested in the past, and can understand a reluctance to support it; however, it is extremely difficult to maintain toolchains by project in travis for the simple reason that the locations of the installed jdks are not obvious and they do keep changing. Is there some place where they are documented? Or perhaps system variables could be defined to allow us to locate them?

Imprint