0

I have IBM Liberty server running on my machine and want to redeploy my WAR using corresponding maven plugin.

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> 

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.

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.

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 .

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.

Charles
  • 4,372
  • 9
  • 41
  • 80
ikos23
  • 4,879
  • 10
  • 41
  • 60

1 Answers1

1

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>
patricktiu
  • 51
  • 1
  • It works but the server does not catch up a new changes. What I mean is I change the code, build a new WAR, deploy (I can see updated WAR in dropins) but Liberty does not redeploy it actually. I need to restart the server to get my changes deployed. If I remove an old WAR first, paste a new one manually - everything works, but the plugin just replaces WAR file and Liberty does not redeploy in that case. – ikos23 May 31 '17 at 08:08
  • 1
    Did you configure applicationMonitor in your server.xml? if you do, you need to set the updateTrigger to its default value. `` – patricktiu May 31 '17 at 18:24
  • It really helped. Thanks ! – ikos23 Jun 01 '17 at 08:07