-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
Apache Maven offers the concept of toolchains to allow you to use different versions of a tools in your build. For exemple you will build your main classes with a JDK7, generate the javadoc with a JDK9 while you'll build and execute your tests with a JDK8.
A toolchains descriptor is something like this :
<?xml version="1.0" encoding="UTF8"?> <toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 http://maven.apache.org/xsd/toolchains-1.1.0.xsd"> <toolchain> <type>jdk</type> <provides> <version>1.6</version> </provides> <configuration> <jdkHome>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home</jdkHome> </configuration> </toolchain> <toolchain> <type>jdk</type> <provides> <version>1.9</version> </provides> <configuration> <jdkHome>/Library/Java/JavaVirtualMachines/jdk1.9.0.jdk/Contents/Home</jdkHome> </configuration> </toolchain> </toolchains>
Jenkins has the ability to automatically deploy the main JDK defined by your build but it could be really interesting to be able to deploy additional JDKs and to automatically generate the toolchains file with the correct paths.