10.6.3. Undeploy an Application with Maven

Summary

This task shows a method for undeploying applications with Maven. The example provided uses the jboss-helloworld.war application found in the JBoss EAP 6 Quickstarts collection. The helloworld project contains a POM file which initializes the jboss-as-maven-plugin. This plug-in provides simple operations to deploy and undeploy applications to and from the application server.

Procedure 10.14. Undeploy an Application with Maven

  1. Open a terminal session and navigate to the directory containing the quickstart examples.

    Example 10.12. Change into the helloworld application directory

    [localhost]$ cd /QUICKSTART_HOME/helloworld
    
  2. Run the Maven undeploy command to undeploy the application.
    [localhost]$ mvn jboss-as:undeploy
  3. View the results.
    • The undeployment can be confirmed by viewing the operation logs in the terminal window.

      Example 10.13. Maven confirmation for undeploy of helloworld application

      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 1 second
      [INFO] Finished at: Mon Oct 10 17:33:02 EST 2011
      [INFO] Final Memory: 11M/212M
      [INFO] ------------------------------------------------------------------------
    • The undeployment can also be confirmed in the status stream of the active application server instance.

      Example 10.14. Application server confirmation for undeploy of helloworld application

      09:51:40,512 INFO  [org.jboss.web] (ServerService Thread Pool -- 69) JBAS018224: Unregister web context: /jboss-helloworld
      09:51:40,522 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016009: Stopping weld service for deployment jboss-helloworld.war
      09:51:40,536 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment jboss-helloworld.war (runtime-name: jboss-helloworld.war) in 27ms
      09:51:40,621 INFO  [org.jboss.as.repository] (management-handler-thread - 10) JBAS014901: Content removed from location /home/username/EAP_HOME/jboss-eap-6.3/standalone/data/content/44/e1f3c55c84b777b0fc201d69451223c09c9da5/content
      09:51:40,621 INFO  [org.jboss.as.server] (management-handler-thread - 10) JBAS018558: Undeployed "jboss-helloworld.war" (runtime-name: "jboss-helloworld.war")
      
Result

The application is undeployed from the application server.