0

Post version 2.346.x, Jenkins forces us to upgrade to Java 11. However, our company policy asks us to stick to Java 8 across all the projects, whatsoever the case would be. (Obvious reason being the budget).
I know that we can still download and install the older version of Jenkins. The problem here is, after some point of time, most of the plugins stop supporting the older Jenkins. Now I can neither upgrade to latest version of Jenkins nor can I stay back on older and keep using the plugins.

So here comes the question - Is there a way to keep using Java 8 compatible Jenkins and all the plugins?

Sid
  • 145
  • 1
  • 11
  • I can understand why you would want to stick to a specific Java version in released software, but are you sure this policy also extends to your internal pipeline infrastructure? Moving to JDK11 would be so much easier than figuring out ways to keep using old (and sometimes insecure) plugins. – M B Oct 11 '22 at 06:34
  • Yes, at least as of now that's the case. In order to use Java 11 in our organization, one will have to follow the typical corporate procedures to get the approval for procuring the license. Well, do you have any suggestions for my query? – Sid Oct 11 '22 at 12:38
  • No I do not, and judging by the lack of any other answers, I'm guessing such a thing is not possible. We once had a pretty old Jenkins machine that we didn't update (both plugins and Jenkins), and when the plugins broke no one fixed them. Eventually we abandoned that version of Jenkins and upgraded, moving to pipeline DSL. Of course in our case, we could switch whenever we wanted. It was just a matter of downloading JDK 14 from the Oracle website and using it. I'm in a pretty big organization where licensing is managed strictly, so I'm surprised you can't do the same. – M B Oct 12 '22 at 07:49
  • Thanks! And looks like I'm gonna land up in a similar situation some day. Well, I've already raised the concern with my management, let's see how it goes. But I'm still looking for some solution to my question. – Sid Oct 12 '22 at 08:29
  • A co-worker of mine was able to fix this problem with latest Jenkins by having “Freestyle” jobs, where you can specify the Maven version to be used. I'm not sure how this exactly works, but just hope this hint might be helpful to develop a solution yourself. (Sadly he doesn't post here.) Good luck! – Marcus Jan 16 '23 at 08:59

1 Answers1

0

If you are using Debian or Ubuntu you can pin a package to the choosen version in the APT configuration

root@debian:~# cat /etc/apt/preferences.d/jenkins
Package: jenkins
Pin: version 2.346
Pin-Priority: 1000

root@debian:~# apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@debian:~# rm /etc/apt/preferences.d/jenkins

root@debian:~# apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  jenkins
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/92.9 MB of archives.
After this operation, 2,204 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
root@debian:~# 
Cyb.org
  • 101
  • 1
  • 3
  • This may ensure that my Jenkins remains on the same version. But how to keep the compatible plugins with it life long? Moreover, some years/months down the line if I want to install Java8 compatible Jenkins, I may not be able to use all the plugins because they might have upgraded to a state demanding Java11+. – Sid Nov 24 '22 at 10:51