Maven goal - liberty:undeploy
You can use the liberty:undeploy goal to remove an application from a Liberty server.
The liberty:undeploy goal removes the specified application from the dropins/ directory of the Liberty server. The server must exist and must be running.
Parameters
The following table describes parameters of the undeploy goal.
Parameter | Description | Required |
---|---|---|
serverHome | Directory location of the Liberty server installation. | Yes, only when assemblyArchive and assemblyArtifact parameters are not set. |
assemblyArchive | Location of the Liberty server compressed archive. The archive is unpacked into a directory as specified by the installDirectory parameter. | Yes, only when serverHome and assemblyArtifact parameters are not set. |
assemblyArtifact | Maven artifact name of the Liberty server assembly. The assembly is installed into a directory as specified by the installDirectory parameter. For more information on Liberty server Maven assemblies, see Installation as a Maven artifact. | Yes, only when serverHome and assemblyArchive parameters are not set. |
installDirectory | Local installation directory location of the Liberty server when the server is installed by using the assembly archive or artifact option. The default value is ${project.build.directory} /liberty. | No |
refresh | If true, re-install Liberty server into the local directory. This is only used when the server is installed by using the assembly archive or artifact option. The default value is false. | No |
serverName | Name of the Liberty server instance. The default value is defaultServer. | No |
appArchive | Name of an application to be undeployed. The application type can be war, ear, rar, eba, zip, or jar. | Yes, if appArtifact parameter is not set. |
appArtifact | Maven artifact name of an application to be undeployed. The application type can be war, ear, rar, eba, zip, or jar. Since liberty-maven-plugin version 1.1. | Yes, if appArchive parameter is not set. |
timeout | Maximum time to wait (in milliseconds) to verify that the undeployment completed successfully. The default value is 40 seconds. | No |
- Example: undeploying an application
- This is the code snippet that you can use in the pom.xml file of your project.
<build> ... <plugins> <plugin> <groupId>com.ibm.websphere.wlp.maven.plugins</groupId> <artifactId>liberty-maven-plugin</artifactId> <version>1.0</version> <executions> ... <execution> <id>undeploy-app</id> <phase>post-integration-test</phase> <goals> <goal>undeploy</goal> </goals> <configuration> <appArchive>HelloWorld.war</appArchive> </configuration> </execution> ... </executions> <configuration> <serverHome>/opt/ibm/wlp</serverHome> <serverName>test</serverName> </configuration> </plugin> </plugins> ... </build>
- Example: undeploying an application from command line
- This is the Maven command that you can use to remove an application from the server.
mvn liberty:undeploy -DserverHome=/opt/ibm/wlp -DserverName=test -DappArchive=HelloWorld.war