Maven integrates the tomcat plug-in and garbled solution, maventomcat

Source: Internet
Author: User

Maven integrates the tomcat plug-in and garbled solution, maventomcat

Maven is already the standard for Java project management. Many people are concerned about how to use Maven to call Web applications during Java EE development. This article describes how to use Maven to introduce the Tomcat plug-in.

Maven Tomcat plug-ins now mainly have two versions, tomcat-maven-plugin and tomcat7-maven-plugin, basically the same way to use.

Official tomcat-maven-plugin plug-in Website: http://mojo.codehaus.org/tomcat-maven-plugin/plugin-info.html.

Tomcat7-maven-plugin plug-in Official Website: http://tomcat.apache.org/maven-plugin.html.

 

Tomcat7-maven-plugin plug-in usage

Configuration

Add the following xml to pom. xm.

<Plugin> groupId> org. codehaus. mojo </groupId> <artifactId> tomcat-maven-plugin </artifactId> <version> 1.1 </version> <configuration>
<! -- Path is the path to access the application --> <path>/wp </path>
<! -- Port is the tomcat port number c --> <port> 8080 </port>
<! -- UriEncoding URL according to the UTF-8 encoding, this solves the Chinese parameter garbled --> <uriEncoding> UTF-8 </uriEncoding> <url> http: // localhost: 8080/manager/html </url>
<! -- Server specifies the tomcat name. -->
<Server> tomcat7 </server>
</Configuration>
</plugin>

  

Agent running


If Maven plug-in is installed in Eclipse, right-click the pom. xml file and choose Run As> Maven build> input tomcat7: run> run.

In this way, Tomcat 7 can run normally.

 

The following describes several common Goal

Command Description
Tomcat: deploy Deploy a web war package
Tomcat: reload Reload the web war package

Tomcat: start

Start tomcat

Tomcat: stop

Stop tomcat

Tomcat: undeploy

Stop a war package
Tomcat: run Start embedded tomcat and run the current project

Tomcat-maven-plugin plug-ins use the same as the tomcat7-maven-plugin plug-ins, as long as<Server> tomcat7 </server><Server> tomcat7 </server>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.