1. Configure standalone to copy the local Tomcat server configuration and run it in the directory specified by standalone, which can be run as a specified port
[html] view plaincopy<plugin> <groupid> Org.codehaus.cargo</groupid> <artifactid>cargo-maven2-plugin </artifactId> <version>1.2.4</version> <configuration> < container> < containerid>tomcat7x</containerid> Execute MVN Package Cargo:start
2. Download and run the Web server
[HTML] View plaincopy<container> <containerId>glassfish3x</containerId> <containerurl>ht Tp://download.java.net/glassfish/3.1.1/release/glassfish-3.1.1.zip</containerurl> </container>
Execute MVN Package Cargo:start
3. Run by existing mode
[html] view plaincopy<plugin> <groupid> Org.codehaus.cargo</groupid> <artifactid>cargo-maven2-plugin </artifactId> <version>1.2.4</version> <configuration> < container> < containerid>tomcat7x</containerid> The port number cannot be specified and it runs directly to the server at the specified location
Execute MVN Package Cargo:start
4. Configuring to a remote Web server
[html] view plaincopy<plugin> <groupid> Org.codehaus.cargo</groupid> <artifactid>cargo-maven2-plugin </artifactId> <version>1.2.4</version> <configuration> < container> < containerid>tomcat7x</containerid> <type>remote</type> </container> <configuration> <type>runtime</type> <properties> <cargo.hostname>localhost</cargo.hostname> <cargo.servlet.port>8080</cargo.servlet.port> <cargo.remote.username>tomcat</ cargo.remote.username> <cargo.remote.password>tomcat</cargo.remote.password> </properties> </configuration> </ Configuration> </plugin>
Run the MVN package Cargo:redeploy to configure the war to the port port of localhost
Run MVN cargo:undeploy unload war
Maven runs to the Web server through the cargo configuration