Maven jetty Tomcat running web project

Source: Internet
Author: User

First, most engineers who use Maven choose Jetty to run web projects, but I do not like this. I like tomcat to run web projects and feel like updating source files, it is much better than jetty and can accelerate development.

 

The Maven Tomcat solution in eclipse is as follows:

 

1. Download tomcatplugin:

: Http://www.eclipsetotale.com/tomcatPlugin.html

 

2. Install atatplugin:

Decompress tomcatpluginv31.zip

Copy the com. sysdeo. Eclipse. tomcat_3.1 folder in the decompressed directory to the Plugins directory in the eclipse installation directory, that is, E:/Eclipse/plugins.

 

Start eclipse. After it is started, you will see a drop-down Tomcat option in your menu, click the window> preferences, and click tomcat in the left Tree, set tomcat version to version 5.x, set Tomcat root directory to E:/tomcat, click tomcat-> JVM setting on the left Tree, and set JRE to jdk1.6.0 _ 21

 

 

3. Add devloader. Jar

Copy devloader.zip under eclipse_home/dropins/[tomcatplugin_home.zip to [tomcat_home]/lib, and change the suffix to jar.

 

4. Specify m2_pepo

Right-click [project] -- properties -- libraries and click Add variable to add the environment variable name: m2_repo, path: D:/. m2/Repository

 

5. Configure Tomcat and Maven Project Association

Right-click [project] -- properties -- tomcat, "is a tomcat project" check box, context name: "/[projectname]", subdirectory to set as Web application root select the webapp directory of the current project; then click the devloader classpath tab active devloader check box, all the packages used below are also selected, but test items must be excluded, such: /[project]/target/test-classes cannot be selected. Otherwise, an error is returned.

 

 

6. Now the environment is ready. Click the Tomcat icon to start the project!

 

7. directly modify the source files in the maven project. The corresponding JSP/html files will be directly updated.

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.