Using jenkins-plugin-manager within an existing Jenkins


I am relatively new to Jenkins so please bear with me. I have an existing very old Jenkins installation 2.249. I have built a new Jenkins version however this lives in a network that has no internet connection so I used jenkins-plugin-manager to download the required plugins.

This works fine running in a vm. I then set up a pipeline in my existing old 2.249 Jenkins to automate this somewhat so I can add new plugins and upload them to a place I can ship them to the new offline Jenkins.

However this is failing as it is picking up the 2.249 version of the Jenkins running the pipeline NOT the 2.387.2 jenkins.war file I downloaded to get the plugins. IS there anyway I can get jenkins-plugin-manager to ignore the Jenkins environment and use the 2.387.2 jenkins.war file instead?

This is the Jenkins file to run the uploads. It is run from a git pull.

pipeline {
	agent any
		stage('Download plugins')
				sh 'java -jar plugins/jenkins-plugin-manager-*.jar --war plugins/jenkins.war --plugin-file plugins/plugins.txt -d plugins/plugins'

and this is the output

/opt/java/jdk-17+35/bin/java -jar plugins/jenkins-plugin-manager-2.12.11.jar --war plugins/jenkins.war --plugin-file plugins/plugins.txt -d plugins/plugins
Multiple plugin prerequisites not met:

caffeine-api (2.9.3-65.v6a_47d0f4d1fe) requires a greater version of Jenkins (2.289.1) than 2.249.3

See the plugin installation manager tool documentation where it says:

  • --jenkins-version: (optional) Version of Jenkins to be used. If not specified, the plugin manager will try to extract it from the WAR file or other sources. The argument can be also set using the JENKINS_VERSION environment variable.

Instead of using the --war argument, use --jenkins-version 2.387.2

1 Like

Marvellous. Thank you. I will give it a go