Answers: <p>Why not use <a href="https://github.com/jenkinsci/plugin-installation-manager-tool" rel="nofollow noreferrer">Plugin installation manager tool</a>?</p>
  
  <p>Your alternative would be the <a href="https://github.com/jenkinsci/docker/blob/master/install-plugins.sh" rel="nofollow noreferrer">install-plugins.sh</a> referenced in the tool readme.md. You can explicitly list all plugins and versions or let it auto-resolve dependencies.</p>
  
  <p>See also answer in S/O re:<a href="https://stackoverflow.com/a/60336214/598141">Jenkins plugins for old versions</a>.</p>
  
Answers: CC BY-SA 4.0
Answers: 2020-06-02T08:28:23.643Z
Answers: My biggest problem is that I find the implementation not so straightforward. That is why I asked both for confirmation and example.Still confirming is good enough for me to continue trying, I will try out again today, if it works, I will accept the answer, if I find problems with it I will continue to wait someone to provide an example. Thanks.
Answers: anVzdGFub3RoZXJodW1hbg
Answers: CC BY-SA 4.0
Answers: 2020-06-02T13:42:17.040Z
Answers: when I do java -jar jenkins-plugin-manager-1.0.2.jar --war /usr/share/jenkins/jenkins.war -l, I don't get the start pack plugins listed. I have tried this: java -jar jenkins-plugin-manager-1.0.2.jar --war /usr/share/jenkins/jenkins.war --plugins blueocean:1.15.0, it failed for one plugin, but other than it has downloaded in a specific folder that has nothing to do to where my plugins are stored. So my expectations was to see the plugins in Jenkins, but there is nothing it it.
Answers: anVzdGFub3RoZXJodW1hbg
Answers: CC BY-SA 4.0
Answers: 2020-06-03T08:15:00.893Z
Answers: I have tried: java -jar jenkins-plugin-manager-1.0.2.jar --war /usr/share/jenkins/jenkins.war --plugins blueocean:1.15.0, I get a bunch of plugins downloaded, one was unable to be downloaded and I get after no plugins in the default folder, that tool is not useful for me at this point.
Answers: anVzdGFub3RoZXJodW1hbg
Answers: CC BY-SA 4.0
Answers: 2020-06-03T10:18:49.627Z
Answers: Update 4, after a lot of debugging it looks like there is some kind of a bug whenever there is a permissions issue on the default DL folder (it doesn't throw warning about it). I have created new one and changed to it and all was executed successfully, it looks like yesterday I had another bad luck due to the global outage of Jenkins. So, right now I only need to understand what I need to do with the downloaded JPI and if all works out as expected, this will be what I needed.
Answers: anVzdGFub3RoZXJodW1hbg
Answers: CC BY-SA 4.0
Answers: 2020-06-04T10:17:06.140Z
Answers: Final update, it worked for what I want to do with:                                                    
  ```mkdir plugin-management-cli;
  cd plugin-management-cli;
  wget https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/plugin-management-parent-pom-1.0.2/jenkins-plugin-manager-1.0.2.jar;
  --plugin-download-directory
  cd ~/plugin-management-cli/plugins/
  sudo chown -R jenkins:jenkins ./*
  sudo cp -R ./* /var/lib/jenkins/plugins
  sudo systemctl stop jenkins
  sudo systemctl status jenkins
  sudo systemctl start jenkins
  sudo systemctl status jenkins```
Answers: anVzdGFub3RoZXJodW1hbg
Answers: CC BY-SA 4.0
Answers: 2020-06-05T10:06:58.227Z
Answers: I am glad you got it working. Managing plugins and their dependencies is a major headache, but is getting better in the newest LTS releases. We try keep it simple by only speaking top level plugins, accept dependencies as resolved, but then track that explicit installed list and only apply security fixes to dependencies until a specified top-level plugin is updated. It's really hard to untangle otherwise.
Answers: Ian W
Answers: CC BY-SA 4.0
Answers: 2020-06-02T07:27:06.247Z
Answers: 2020-06-02T20:43:11.497Z
Answers: 2020-06-02T20:43:11.497Z
Answers: Ian W
Body: <p>Which tool should I be using in order to be able to control Jenkins plugins from a cli/script in such way that when I have a new installation (e.g. 2.164.3)?</p>
  
  <p>For example, I want to type blueocean - 1.1.15 (older version then current for example) and it will download the dependencies for the given version without messing everything else?</p>
  
  <p>As I see I shouldn't be using jenkins-cli, but <a href="https://github.com/jenkinsci/plugin-installation-manager-tool" rel="nofollow noreferrer">https://github.com/jenkinsci/plugin-installation-manager-tool</a>? If so can anyone provide a simple example for the scenario I have given as the documentation is short of simple/clear examples.</p>
  
  <p>The already existing topics are not answering the question in 2020 and I can't solve my scenario with them.</p>
  
Tags: <jenkins-plugins>
Title: Jenkins 2.164.3 - programmable plugins installations for specific versions
UserDisplayName: anVzdGFub3RoZXJodW1hbg
ThreadText: # Jenkins 2.164.3 - programmable plugins installations for specific versions
  
  (Asked by: username_0 on 2020-06-01)
  
  Which tool should I be using in order to be able to control Jenkins plugins from a cli/script in such way that when I have a new installation (e.g. 2.164.3)?
  
  For example, I want to type blueocean - 1.1.15 (older version then current for example) and it will download the dependencies for the given version without messing everything else?
  
  As I see I shouldn't be using jenkins-cli, but <https://github.com/jenkinsci/plugin-installation-manager-tool>? If so can anyone provide a simple example for the scenario I have given as the documentation is short of simple/clear examples.
  
  The already existing topics are not answering the question in 2020 and I can't solve my scenario with them.
  
  **Tags:** jenkins-plugins
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-06-02. Score: 1 | Accepted answer
  
  Why not use [Plugin installation manager tool](https://github.com/jenkinsci/plugin-installation-manager-tool)?
  
  Your alternative would be the [install-plugins.sh](https://github.com/jenkinsci/docker/blob/master/install-plugins.sh) referenced in the tool readme.md. You can explicitly list all plugins and versions or let it auto-resolve dependencies.
  
  See also answer in S/O re:[Jenkins plugins for old versions](https://stackoverflow.com/a/60336214/598141).
  
  > **Comments:**
  > **username_0**: My biggest problem is that I find the implementation not so straightforward. That is why I asked both for confirmation and example.Still confirming is good enough for me to continue trying, I will try out again today, if it works, I will accept the answer, if I find problems with it I will continue to wait someone to provide an example. Thanks.  
  > **username_0**: when I do java -jar jenkins-plugin-manager-1.0.2.jar --war /usr/share/jenkins/jenkins.war -l, I don't get the start pack plugins listed. I have tried this: java -jar jenkins-plugin-manager-1.0.2.jar --war /usr/share/jenkins/jenkins.war --plugins blueocean:1.15.0, it failed for one plugin, but other than it has downloaded in a specific folder that has nothing to do to where my plugins are stored. So my expectations was to see the plugins in Jenkins, but there is nothing it it.  
  > **username_0**: I have tried: java -jar jenkins-plugin-manager-1.0.2.jar --war /usr/share/jenkins/jenkins.war --plugins blueocean:1.15.0, I get a bunch of plugins downloaded, one was unable to be downloaded and I get after no plugins in the default folder, that tool is not useful for me at this point.  
  > **username_0**: Update 4, after a lot of debugging it looks like there is some kind of a bug whenever there is a permissions issue on the default DL folder (it doesn't throw warning about it). I have created new one and changed to it and all was executed successfully, it looks like yesterday I had another bad luck due to the global outage of Jenkins. So, right now I only need to understand what I need to do with the downloaded JPI and if all works out as expected, this will be what I needed.  
  > **username_0**: Final update, it worked for what I want to do with:                                                     ```mkdir plugin-management-cli; cd plugin-management-cli; wget https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/plugin-management-parent-pom-1.0.2/jenkins-plugin-manager-1.0.2.jar; --plugin-download-directory cd ~/plugin-management-cli/plugins/ sudo chown -R jenkins:jenkins ./* sudo cp -R ./* /var/lib/jenkins/plugins sudo systemctl stop jenkins sudo systemctl status jenkins sudo systemctl start jenkins sudo systemctl status jenkins```  
  > **username_1**: I am glad you got it working. Managing plugins and their dependencies is a major headache, but is getting better in the newest LTS releases. We try keep it simple by only speaking top level plugins, accept dependencies as resolved, but then track that explicit installed list and only apply security fixes to dependencies until a specified top-level plugin is updated. It's really hard to untangle otherwise.  
  
  ---
  
  