简体   繁体   English

有没有办法从终端启动本地 Java IBM Liberty Server?

[英]Is there a way to start a local Java IBM Liberty Server from terminal?

Is there a way to start/stop a Liberty Server from terminal/command line?有没有办法从终端/命令行启动/停止 Liberty 服务器? I tried some commands but no luck so far我尝试了一些命令但到目前为止没有运气

Eclipse IDE 视图

Yes, there are a few ways to start Liberty on the command line.是的,有几种方法可以在命令行上启动 Liberty。

A) Directly with server script A) 直接使用服务器脚本

Locate your Liberty install ( $WLP_INSTALL_DIR ), the sever can be started in the background using the command $WLP_INSTALL_DIR/bin/server start <serverName> .找到您的 Liberty 安装 ( $WLP_INSTALL_DIR ),可以使用命令$WLP_INSTALL_DIR/bin/server start <serverName>在后台$WLP_INSTALL_DIR/bin/server start <serverName>

For example: /path/to/wlp/bin/server start myServer例如: /path/to/wlp/bin/server start myServer

For doc on starting/stopping the server, see the Server Commands reference.有关启动/停止服务器的文档,请参阅服务器命令参考。

B) Using the Liberty Maven plugin B) 使用 Liberty Maven 插件

If your project uses Maven, there is a Liberty plugin that provides some very helpful tasks, such as:如果您的项目使用 Maven,则有一个 Liberty 插件可以提供一些非常有用的任务,例如:

  • mvn liberty:start starts a Liberty server in the background mvn liberty:start Liberty mvn liberty:start在后台启动 Liberty 服务器
  • mvn liberty:run starts a Liberty server in the foreground mvn liberty:run Liberty mvn liberty:run在前台启动 Liberty 服务器
  • mvn liberty:dev starts a Liberty server in "dev mode" where code/config changes are automatically updated without needing to restart your server mvn liberty:dev Liberty mvn liberty:dev以“开发模式”启动 Liberty 服务器,其中代码/配置更改会自动更新,而无需重新启动服务器

To learn more about the Liberty Maven plugin, check out the Liberty guide here要了解有关 Liberty Maven 插件的更多信息,请在此处查看Liberty 指南

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM