此内容没有您所选择的语言版本。
10.6. Deploy with Maven
10.6.1. Manage Application Deployment with Maven 复制链接链接已复制到粘贴板!
10.6.2. Deploy an Application with Maven 复制链接链接已复制到粘贴板!
Prerequisites
This task shows a method for deploying 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. Deploy an application with Maven
- Open a terminal session and navigate to the directory containing the quickstart examples.
Example 10.11. Change into the helloworld application directory
cd /QUICKSTART_HOME/helloworld
[localhost]$ cd /QUICKSTART_HOME/helloworld
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Run the Maven deploy command to deploy the application. If the application is already running, it will be redeployed.
mvn package jboss-as:deploy
[localhost]$ mvn package jboss-as:deploy
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - View the results.
- The deployment can be confirmed by viewing the operation logs in the terminal window.
Example 10.12. Maven confirmation for helloworld application
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The deployment can also be confirmed in the status stream of the active application server instance.
Example 10.13. Application server confirmation for helloworld application
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The application is deployed to the application server.
10.6.3. Undeploy an Application with Maven 复制链接链接已复制到粘贴板!
Prerequisites
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.15. Undeploy an Application with Maven
- Open a terminal session and navigate to the directory containing the quickstart examples.
Example 10.14. Change into the helloworld application directory
cd /QUICKSTART_HOME/helloworld
[localhost]$ cd /QUICKSTART_HOME/helloworld
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Run the Maven undeploy command to undeploy the application.
mvn jboss-as:undeploy
[localhost]$ mvn jboss-as:undeploy
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - View the results.
- The undeployment can be confirmed by viewing the operation logs in the terminal window.
Example 10.15. Maven confirmation for undeploy of helloworld application
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The undeployment can also be confirmed in the status stream of the active application server instance.
Example 10.16. Application server confirmation for undeploy of helloworld application
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The application is undeployed from the application server.