The jenkins-cli.jar has been downloaded.
It is able to run.
When one tries to check the syntax of a jenkinsfile by running java -jar ~/Desktop/jenkins-cli.jar -s https://<jenkins_url> -noCertificateCheck declarative-linter < Jenkinsfile
it results in:
Sep 27, 2017 10:46:18 AM hudson.cli.CLI _main
INFO: Skipping HTTPS certificate checks altogether. Note that this is not secure at all.
Sep 27, 2017 10:46:34 AM hudson.cli.CLI$5 run
WARNING: null
java.io.IOException: Stream is closed
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3512)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3486)
at java.io.DataOutputStream.writeInt(DataOutputStream.java:197)
at hudson.cli.PlainCLIProtocol$EitherSide.send(PlainCLIProtocol.java:188)
at hudson.cli.PlainCLIProtocol$EitherSide.send(PlainCLIProtocol.java:195)
at hudson.cli.PlainCLIProtocol$EitherSide$1.write(PlainCLIProtocol.java:215)
at hudson.cli.CLI$5.run(CLI.java:699)
@Tensibai asked whether there is an authentication issue. Authentication was done, but it is unclear whether it was succesfull or not:
$ java -jar ~/Desktop/jenkins-cli.jar -noCertificateCheck -s https://<jenkins url> login --username <username> --password <password>
Sep 27, 2017 10:57:17 AM hudson.cli.CLI _main
INFO: Skipping HTTPS certificate checks altogether. Note that this is not secure at all.
java -jar ~/Desktop/jenkins-cli.jar -s https://<jenkins_url> -noCertificateCheck --username <username> --password <password> declarative-linter < Jenkinsfile
? there's a bunch of blur about auth with different versions on jenkins site