Below is a command to verify that I am authenticated:
java -jar jenkins-cli.jar -s http://myserver/jenkins who-am-i
Authenticated as: myuser
Authorities:
authenticated
java -jar jenkins-cli.jar -s http://myserver/jenkins groovysh 'jenkins.model.Jenkins.instance.pluginManager.plugins.each { println("${it.longName} - ${it.version}") };'
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
at $Proxy2.main(Unknown Source)
at hudson.cli.CLI.execute(CLI.java:271)
at hudson.cli.CLI._main(CLI.java:417)
at hudson.cli.CLI.main(CLI.java:322)
It's a bug of Jenkins. The workaround is create a groovy script, then run that script via Jenkins CLI.
java -jar jenkins-cli.jar -s http://myserver/jenkins/ groovy test_script.gsh
No comments:
Post a Comment