We would like to use an Agent Template
maven-jdk-7 i.e. using a Agent with Maven using Java 7.
- CloudBees Jenkins Enterprise (CJE)
- Docker Template Agents Maven JDK7
Java 7 is not longer supported by CloudBees (CloudBees Supported Java) for any type of node. Thus, it is extensible to CJE agents too.
Workaround: Create your own Docker Image (
Dockerfile) making available Java 7 for Maven and 8 for
- In your
PATHyou declare the path to the Java 8 bin folder.
- In you docker image (or in the agent template config) you configure
JAVA_HOMEto point to the JDK 7 and then Maven will use it.
Note: The normal procedure for providing tools to Agents (e.g JDK7) is via GUI Manage Jenkins > Global Tool Configuration but tools would be downloaded each time the agent is connected because it is Docker Agent (ephemeral), thus it is not recommended.