I'm trying to use Jenkins CLI to install a Jenkins plugin, however receiving an error.
Plugin install command:
java -jar jenkins-cli.jar -s http://<jenkins_ip>:8080/ -auth @/home/ec2-user/credentials install-plugin parameterized-trigger http://updates.jenkins-ci.org/download/plugins/sonar/2.13/sonar.hpi restart
Error:
Installing a plugin from http://updates.jenkins-ci.org/download/plugins/sonar/2.13/sonar.hpi
ERROR: Unexpected exception occurred while performing install-plugin command.
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:225)
at java.util.zip.ZipFile.<init>(ZipFile.java:155)
at java.util.jar.JarFile.<init>(JarFile.java:166)
at java.util.jar.JarFile.<init>(JarFile.java:130)
at hudson.cli.InstallPluginCommand.moveToFinalLocation(InstallPluginCommand.java:177)
at hudson.cli.InstallPluginCommand.run(InstallPluginCommand.java:111)
at hudson.cli.CLICommand.main(CLICommand.java:249)
at hudson.cli.CLIAction$ServerSideImpl.run(CLIAction.java:277)
at hudson.cli.CLIAction$PlainCliEndpointResponse$1.run(CLIActio
What I have tried out:
- Changing java version, now I have tried for both java 8 and 11.
- Re downloading jenkins CLI to ensure it's not corrupted
- Install a similar plugin from the Jenkins interface and this worked successfully.
- Other Jenkins CLI commands such as list-plugins work successfully.
- Zip is installed on the linux server on which I'm running jenkins CLI commands. Jenkins application runs on the same server.
Jenkins version: Jenkins 2.263.4
Appreciate an input on this.
Thank You