Ant 启动和停止WebSphereServerRemote

Ant 启动和停止WebSphereServerRemote,ant,websphere,websphere-traditional,Ant,Websphere,Websphere Traditional,我需要启动和停止WebSphere服务器的脚本 我的需求是需要编写build.xml,我需要在Hudson中配置它 启动和停止web sphere应用程序服务器 我完成了所有的任务,但停止和开始在蚂蚁脚本不熟悉。 请提供任何示例。这取决于您使用的是WebSphere Classic还是WebSphere Liberty。这两种产品都有启动/停止服务器脚本,但它们略有不同 WebSphere Classic: 开始:$WAS\u INSTALL\u HOME/bin/startServer 停止:

我需要启动和停止WebSphere服务器的脚本

我的需求是需要编写build.xml,我需要在Hudson中配置它 启动和停止web sphere应用程序服务器

我完成了所有的任务,但停止和开始在蚂蚁脚本不熟悉。
请提供任何示例。

这取决于您使用的是WebSphere Classic还是WebSphere Liberty。这两种产品都有启动/停止服务器脚本,但它们略有不同

WebSphere Classic:
开始:$WAS\u INSTALL\u HOME/bin/startServer
停止:$WAS\u INSTALL\u HOME/bin/stopServer

WebSphere Liberty:
开始:$WLP\u INSTALL\u HOME/bin/server start
停止:$WLP\u安装\u主页/bin/server停止

一旦知道如何手动执行这些命令,就可以使用ant任务在远程服务器上运行这些命令

<sshexec host="somehost" username="user1" password="pwd1" command="/path/to/WAS/bin/server start myserver"/>

使用以下ant脚本启动和停止WebSphere Server:

<!--Stop Server--><sshexec host="websphere.host.IP" username="websphere.host.username" password="websphere.host.password"
        command="$sudo server_location/bin/stopServer.sh server_name" trust="true" />

<!--Start Server--><sshexec host="websphere.host.IP" username="websphere.host.username" password="websphere.host.password"
        command="$sudo server_location/bin/startServer.sh server_name" trust="true" />