Running jenkins-plugin-file

Hello, I am installing plugins with this command and a file with the list of plugins but they do not get installed. When running it, it results in a “Done” message. If I add verbosity, it displays this:

jenkins-plugin-cli --plugin-file /var/jenkins_home/pluginsList/plugins-list.txt --verbose
File containing list of plugins to be downloaded: /var/jenkins_home/pluginsList/plugins-list.txt
Reading in plugins from /var/jenkins_home/pluginsList/plugins-list.txt

No directory to download plugins entered. Will use default of /usr/share/jenkins/ref/plugins
Using update center https://updates.jenkins.io/update-center.json from JENKINS_UC environment variable
Using experimental update center https://updates.jenkins.io/experimental/update-center.json from JENKINS_UC_EXPERIMENTAL environment variable
Using incrementals mirror https://repo.jenkins-ci.org/incrementals from JENKINS_INCREMENTALS_REPO_MIRROR environment variable
No CLI option or environment variable set for plugin info, using default of https://updates.jenkins.io/plugin-versions.json
No war entered. Will use default of /usr/share/jenkins/jenkins.war

Retrieving update center information
Update center URL: https://updates.jenkins.io/update-center.json?version=2.498
Returning cached value for: update-center-2.498
Returning cached value for: plugin-versions
Couldn't find checksum for antisamy-markup-formatter at version: latest

antisamy-markup-formatter has no dependencies
Setting checksum for: antisamy-markup-formatter to KbR2V5fybERXSicy3fnX2Y6gKDKVNSSX3Z7vhK7QEC8=
Couldn't find checksum for ant at version: latest

ant depends on: 
structs 338.v848422169819
Skipping dependency structs:338.v848422169819 and its sub-dependencies, because there is a higher version defined on the top level - structs:latest
Setting checksum for: ant to q9ofJ3pDEf7SrDBXpMmwb2MTwvC0i04lclb6mpqOQ/s=
Couldn't find checksum for apache-httpcomponents-client-4-api at version: latest

[.... Many other plugins with same messages ...]

Done

the plugin-list file is like

antisamy-markup-formatter
ant

Where can the problem be? It’s a brand new installation. I just remove plugins folder and execute the command to test if it installs all plugins properly.

Thank you

The plugins are downloaded to /usr/share/jenkins/ref/plugins as you can see from the log
Do you run Jenkins as docker container with the official image? If not you would need to adjust the call so that it downloads the plugins directly to the plugins folder of Jenkins.

wow, sorry so obvious. Things that led me to this error:

  • I asked chatGPT if destiny directory could be changed and it has said " No, jenkins-plugin-cli does not provide a direct option to specify a custom destination folder for downloading plugins. By default, it installs plugins into /var/jenkins_home/plugins inside the container."
  • I assumed that the path mentioned on the verbose was a temporary directory
  • I read too fast the command help, it’s in there “–plugin-download-directory”

I use it with official docker hub image (jenkins/jenkins) but I had to specify the path.

Thank you