简体   繁体   English

使用SSH在远程Windows计算机上调用jar

[英]Invoke jar on remote windows machine using SSH

I'm using Bamboo as a CI (living on an AWS linux box) and have setup an SSH task where by I wish to invoke a jar file on another, physical, Windows machine. 我使用Bamboo作为CI(位于AWS linux盒上),并设置了SSH任务,希望通过该任务在另一台物理Windows机器上调用jar文件。 I have setup an SSH client on the Windows machine (Dameware SSH) and have setup a user called admin / admin. 我已经在Windows计算机(Dameware SSH)上设置了SSH客户端,并设置了一个名为admin / admin的用户。

The jar file runs a tool called SeInterpreter to run interpret .json selenium tests into webdriver tests. jar文件运行一个名为SeInterpreter的工具,以将.json硒测试运行到Webdriver测试中。

I have a lack of knowledge around the format for the shell script I need to run in order to invoke the jar on the remote machine. 我缺少为调用远程计算机上的jar而需要运行的shell脚本格式的知识。 I have cobbled the following together: 我将以下各项拼凑在一起:

ssh admin@L-IS03159.nt.ad.local cmd /c cd /d "c:/SeInterpreterB11" cmd /c java -jar SeInterpreter.jar --driver=Remote --driver.browserName=firefox --driver.url=http://L-IS03159.nt.ad.local:4444/wd/hub/ C:/seleniumBuilderPOC/tests/loadHomePageSearchHomepage.json

The error from Bamboo is: Bamboo的错误是:

23-Jul-2014 15:36:12    Unable to execute command or shell on remote system: Failed to Execute process.
23-Jul-2014 15:36:12    Result: exit code = -1
23-Jul-2014 15:36:12    SSH command failed. Failing build.

Can anyone see obvious errors in the script syntax? 谁能在脚本语法中看到明显的错误?

Your command line has the following form: 您的命令行具有以下形式:

ssh user@hostname cmd /c [cd command] cmd /c [java command] ssh user @ hostname cmd / c [cd命令] cmd / c [java命令]

Try the following form, instead: 请尝试以下形式:

ssh user@hostname cmd /c "[cd command] && [java command]" ssh user @ hostname cmd / c“ [cd命令] && [java命令]”

&& is a command separator in cmd.exe. &&是cmd.exe中的命令分隔符。

You may run into issues with the quotation marks in cd /d "c:/SeInterpreterB11" . cd /d "c:/SeInterpreterB11"的引号可能会引起问题。 Since there are no spaces in this path, the quotes aren't necessary. 由于此路径中没有空格,因此不需要引号。 Consider removing them to avoid headaches dealing with quote escaping. 考虑删除它们,以避免麻烦处理引号转义。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Windows机器中通过Java代码调用Appium服务器和模拟器 - How to invoke the appium server and emulator via Java code in windows machine 为什么Windows机器上的FireFox远程Web驱动程序没有头? - Why FireFox remote web driver is headless on a windows machine? SSH命令使用Jenkins在从属计算机上启动“ webdriver-manager” - SSH command to start “webdriver-manager” on slave machine using Jenkins 为什么在 windows vm 上通过 ssh 打开 jar 文件以隐身方式打开浏览器? - Why opening a jar file thru ssh on a windows vm opens the browser incognito? 如何使用Jenkins将Selenium测试重定向到远程计算机 - How to redirect Selenium tests to remote machine using Jenkins 如何使用Jenkins在远程机器上运行selenium脚本 - How to run selenium script on remote machine using Jenkins 如何在 linux 机器上使用 Selenium 远程 webdriver 在弹出窗口中上传文件 - How to upload a file in popup using Selenium remote webdriver on linux machine 使用@Test批注在远程计算机和本地计算机中并行运行一个测试用例 - Running one testcase in parallel in remote machine and local machine using @Test annotation 使用Java将文件从本地计算机复制到远程计算机时需要帮助 - Need help in copying a file from local machine to remote machine using java 使用远程Webdriver在远程计算机上打开html文件时显示“找不到文件” - opening a html file on remote machine using remote webdriver says “file not found”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM