Jenkins-plugin-manager doesn't seem to be doing something

Hi

I have a clean jenkins setup without any plugins. I wanted to use jenkins-plugin-manager to install the plugins but it doesn’t seem to be doing anything, or my expectations are wrong

I run jenkins 2.401.2, on ubuntu 22.04 as a systemd service with

[Unit]
Description=Jenkins Continuous Integration Server
Requires=network.target
After=network.target

[Service]
Type=notify
NotifyAccess=main
ExecStart=/usr/bin/jenkins
Restart=on-failure
SuccessExitStatus=143

User=jenkins
Group=jenkins

Environment="JENKINS_HOME=/var/lib/jenkins"
WorkingDirectory=/var/lib/jenkins
Environment="JENKINS_WEBROOT=%C/jenkins/war"
Environment="JAVA_OPTS=-Djava.awt.headless=true -Djenkins.install.runSetupWizard=false"
Environment="JENKINS_PORT=8080"
Environment="CASC_JENKINS_CONFIG=/var/lib/jenkins/casc.yaml"

[Install]
WantedBy=multi-user.target

I have a demo casc.yaml file like this (doesn’t seem to work either but this is probably another discussion)

jenkins:
  securityRealm:
    local:
      allowsSignup: false
      users:
       - id: "admin"
         password: "admin"
  authorizationStrategy:
    globalMatrix:
      permissions:
        - "Overall/Administer:admin"
        - "Overall/Read:authenticated"
unclassified:
  location:
    url: http://example.com

I run jenkins-plugin-manager with

$ java -jar /usr/share/jenkins/jenkins-plugin-manager.jar --war /usr/share/java/jenkins.war  --plugins ant:latest  --verbose
No .txt or .yaml file containing list of plugins to be downloaded entered.
No directory to download plugins entered. Will use default of /usr/share/jenkins/ref/plugins
No CLI option or environment variable set for update center, using default of https://updates.jenkins.io/update-center.json
No CLI option or environment variable set for experimental update center, using default of https://updates.jenkins.io/experimental/update-center.json
No CLI option or environment variable set for incrementals mirror, using default of https://repo.jenkins-ci.org/incrementals
No CLI option or environment variable set for plugin info, using default of https://updates.jenkins.io/plugin-versions.json
Will use war file: /usr/share/java/jenkins.war
Jenkins version: 2.401.2

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

ant depends on: 
structs 324.va_f5d6774f3a_d
Setting checksum for: structs to Zd0KaMZjsI4w7SVPN1SenM+rGNJ+TxGCzH7tbU0CyVg=

structs has no dependencies
Setting checksum for: ant to M902JPous9Yv7jGdGBmOW78CNOaJa7/2Z1UtQpeRvy0=
Setting checksum for: ant to M902JPous9Yv7jGdGBmOW78CNOaJa7/2Z1UtQpeRvy0=
Done

but when I visit /manage/pluginManager/installed it says ‘No plugins installed.’

in the default download dir I see several .jpi files

1 Like

Found the problem the command
java -jar /usr/share/jenkins/jenkins-plugin-manager.jar ... (mentioned above) was downloading plugins by default in the same dir as the jar file (/usr/share/jenkins/ref/plugins)

I had to use the option --plugin-download-directory to download it to jenkins’ default plugin directory (or change jenkins’ option --pluginroot)

java -jar /usr/share/jenkins/jenkins-plugin-manager.jar --war /usr/share/java/jenkins.war --plugin-file /usr/share/jenkins/ref/plugins.txt --plugin-download-directory  /var/lib/jenkins/plugins/

Thanks for your feedback. :+1: