10.6.3. Maven によるアプリケーションのアンデプロイ
前提条件
概要
このタスクでは、Maven を用いてアプリケーションをアンデプロイする方法について説明します。ここで使用される例は、JBoss EAP 6 のクイックスタートにある jboss-helloworld.war
アプリケーションを使用します。helloworld
プロジェクトには、jboss-as-maven-plugin
を初期化する POM ファイルが含まれています。このプラグインを使用すると、アプリケーションサーバーでアプリケーションを簡単にデプロイおよびアンデプロイできます。
手順10.14 Maven によるアプリケーションのアンデプロイ
- ターミナルセッションを開き、quickstart サンプルが含まれるディレクトリーに移動します。
例10.12 helloworld アプリケーションディレクトリーへの移動
[localhost]$ cd /QUICKSTART_HOME/helloworld
- Maven アンデプロイコマンドを実行してアプリケーションをアンデプロイします。
[localhost]$ mvn jboss-as:undeploy
- 結果を確認します。
- アンデプロイメントは、ターミナルウィンドウの操作ログを参照して確認できます。
例10.13 Maven による helloworld アプリケーションのアンデプロイの確定
[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] ------------------------------------------------------------------------
- また、アンデプロイメントは、アクティブアプリケーションサーバーインスタンスのステータスストリームで確認することもできます。
例10.14 アプリケーションサーバーによる helloworld アプリケーションのアンデプロイの確定
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")
結果
アプリケーションが、アプリケーションサーバーからアンデプロイされます。