Sadly it's more complex - the build is started on jdk8 and javac forked
on jdk6. So we need both, and the possibility to access the jdk from
within maven.
I tried a "pure" jdk6 build on my windows machine and that failed for
several reasons, one of them being the failure of an external download
because IIRC an incompatibility on SSL protocols. That must have neen
the reason we stopped doing a "pure" jdk6 build years ago.
On my Windows machine, the maven build is started on jdk8 but with
-Djdk.path="C:/Program Files/Java/jdk1.6.0_45" in the command line.
That's why I asked for the directory, obviously the jdk6 won't be in
"/home/jenkins/tools/java/..." in that image.
Tilman
Am 10.10.2019 um 07:31 schrieb Lukasz Lenart:
śr., 9 paź 2019 o 19:58 Tilman Hausherr <[email protected]> napisał(a):
Thanks, but I doubt that it will be simple... I assume that in your
configuration, "maven:3-jdk-8" is a reference to the image that will be
chosen. Is there a repository for this or will this be created
"magically" just by using the correct name, e.g. "maven:3.2.1-jdk-6"? I
searched for your image name and found this:
Yes, this is an official Maven image from Docker Hub
https://hub.docker.com/_/maven
however it does not have jdk-6. Same on https://hub.docker.com/_/maven
And if I have the image I need, where in the docker image will I find
the jdk? On Jenkins the jdk is at
/home/jenkins/tools/java/jdk1.6.0_20-32-unlimited-security
You can use this image [1]: "andreptb/maven:3.2.5-jdk6" so in your
case just replace line 6 of the Jenkinsfile [2] and you are done.
Basically the selected Docker image provides a given JDK version and
Maven bundled together - this is independent from Jenkins toolset and
it doesn't depend if Jenkins provides the JDK you need.
[1] https://github.com/andrealbinop/Dockerfiles/tree/master/maven/jdk-6
[2] https://github.com/apache/struts/blob/master/Jenkinsfile
Regards