此消息僅表示jenkins-cli.jar不在您的$ PATH或您運行java的相同目錄中。
這裏,jenkins-cli.jar文件位於我的$ HOME/bin目錄中。起初,我嘗試從我的$ HOME
➜ ~ java -jar jenkins-cli.jar
Error: Unable to access jarfile jenkins-cli.jar
從$ HOME/bin中
➜ ~ cd bin
➜ ~/bin ls -al jenkins-cli.jar
-rw-rw-r-- 1 user user 2849829 juin 23 10:04 jenkins-cli.jar
➜ ~/bin java -jar jenkins-cli.jar
Neither -s nor the JENKINS_URL env var is specified.
Jenkins CLI
Usage: java -jar jenkins-cli.jar [-s URL] command [opts...] args...
Options:
-s URL : the server URL (defaults to the JENKINS_URL env var)
-http : use a plain CLI protocol over HTTP(S) (the default; mutually exclusive with -ssh and -remoting)
-ssh : use SSH protocol (requires -user; SSH port must be open on server, and user must have registered a public key)
-remoting : use deprecated Remoting channel protocol (if enabled on server; for compatibility with legacy commands or command modes only)
-i KEY : SSH private key file used for authentication (for use with -ssh or -remoting)
-p HOST:PORT : HTTP proxy host and port for HTTPS proxy tunneling. See https://jenkins.io/redirect/cli-https-proxy-tunnel
-noCertificateCheck : bypass HTTPS certificate check entirely. Use with caution
-noKeyAuth : dont try to load the SSH authentication private key. Conflicts with -i
-user : specify user (for use with -ssh)
-strictHostKey : request strict host key checking (for use with -ssh)
-logger FINE : enable detailed logging from the client
-auth [ USER:SECRET | @FILE ] : specify username and either password or API token (or load from them both from a file);
for use with -http, or -remoting but only when the JNLP agent port is disabled
The available commands depend on the server. Run the help command to
see the list.
運行它現在下面你分享的鏈接上的說明後,我仍然得到了同樣的問題。我無法訪問jar文件jenkins-cli.jar –