如何使用liberty-maven-plugin重新部署工件? [英] How to redeploy artifact with liberty-maven-plugin?
问题描述
我的机器上正在运行IBM Liberty服务器,并想使用相应的maven插件重新部署我的WAR.
I have IBM Liberty server running on my machine and want to redeploy my WAR using corresponding maven plugin.
文档说,有一些目标,例如deploy
,undeploy
,install-apps
.目前我正在使用
The documentation says that there are goals like deploy
, undeploy
, install-apps
. Currently I am using
<plugin>
<groupId>com.ibm.websphere.wlp.maven.plugins</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>install-apps</id>
<phase>install</phase>
<goals>
<goal>install-apps</goal>
</goals>
</execution>
</executions>
<configuration>
<serverHome>c:/my-liberty-instance</serverHome>
<serverName>myServerName</serverName>
</configuration>
</plugin>
但这对我不好,因为它要求服务器实例在此之前停止.如果它正在运行-会部署一个新的WAR(代替旧的WAR),但不会捕获新的更改.
But it's not good for me because it requires the server instance to be stopped before. If it's running - a new WAR is deployed (it replaces the old one) but no new changes are caught up.
我尝试使用deploy
目标,但是一旦将WAR复制到dropins
目录-它开始在console.log文件中搜索一些行,该行应指示应用程序是否已启动以及是否失败.
I've tried to use deploy
goal but once it copies WAR to the dropins
directory - it starts searching some console.log file for some line that should indicate if app is started and FAILS.
undeploy
目标的示例:CWWKM2022E: Failed to undeploy application app-1.0-SNAPSHOT.war. The Stop application message cannot be found in console.log.
但是对于deploy
,stop-server
也会出现相同的消息.
Example for undeploy
goal : CWWKM2022E: Failed to undeploy application app-1.0-SNAPSHOT.war. The Stop application message cannot be found in console.log.
But the same message appears for deploy
, stop-server
.
是否有一种方便的方法可以在不需要重启服务器的情况下使用liberty-maven-plugin重新部署WAR? 我只想构建一个新的WAR-进行部署;希望服务器赶上更改,仅此而已.
Is there a convenient way to redeploy WAR using liberty-maven-plugin where I don't need to restart the server ? I just want to build a new WAR - deploy it; want the server to catch up the changes and that's it.
推荐答案
您可以使用install-apps目标在不停止自由服务器实例的情况下安装项目war文件.但是您需要使用liberty-maven-plugin版本1.3 or above
,并在插件配置中包含<installAppPackages>project</installAppPackages>
.
You can use the install-apps goal to install the project war file without your liberty server instance stopped. But you need to use liberty-maven-plugin version 1.3 or above
, and also include <installAppPackages>project</installAppPackages>
to the plugin configuration.
<plugin>
<groupId>net.wasdev.wlp.maven.plugins</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>install-apps</id>
<phase>install</phase>
<goals>
<goal>install-apps</goal>
</goals>
</execution>
</executions>
<configuration>
<installDirectory>c:/my-liberty-instance</installDirectory>
<serverName>myServerName</serverName>
<installAppPackages>project</installAppPackages>
</configuration>
</plugin>
这篇关于如何使用liberty-maven-plugin重新部署工件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!