Maven+tomcat+eclipse Hot Deployment

Source: Internet
Author: User

One: Research and development tools ( recommended )

Eclipse:eclipse-jee-kepler-sr2-win32-x86_64.zip ( comes with maven)

tomcat:apache-tomcat-7.0.53

mysql:5.0

in the Introduction to Project ( The process may be a bit slow because the need to download the project requires the jar The download directory for the file is

II: Eclipse Remote Debug Debug

1, edit Tomcat\bin\catalina.bat, in

REM Guess catalina_home if not defined
Set "current_dir=?%"

Before you add the following code to bind a port 8787:

If ""%1 "" = = "" Stop "goto skip_config

SET Catalina_opts=-server-xdebug-xnoagent-djava.compiler=none-xrunjdwp:transport=dt_socket,server=y,suspend=n, address=8787

: Skip_config

address refers to the binding of starting Port 8787.

2, configure in Eclipse:

Right-click Project->debug as->debug Configurations



Locate the Remote Java application in the pop-up settings box with your own project, set port to 8787, and then apply->close:



OK, Setup is complete. The first thing to do is to run Start.bat to start Tomcat, but this is just a generic boot, not yet in debug mode. To Debug, you should right-click on the project->debug as->debug configurations->remote Java application->passing (own project name)->debug. After that, we can break the point of Debug.

3: setting.xml copied to c:\users\administrator\.m2 Directory below

<servers>
<server>
<id>tomcat</id>
<username>admin</username>
<password>[email protected]#</password>
</server>
</servers>

Three: Tomcat:redeploy Hot deployment

Edit the Pom.xml of the project and add the following content

<plugin>
<groupid>org.codehaus.mojo</groupid>
<artifactid>tomcat-maven-plugin</artifactid>
<version>1.1</version>
<configuration>
<server>tomcat</server>
Span style= "White-space:pre" > <username>admin</username>
<password>[email protected]#</password>
< Url>http://127.0.0.1:8080/manager/text</url>
<path>/ Bright</path>
</configuration>
</plugin>

(1) Catalina.bat to start Tomcat

(2) Right-click on the project or Pom.xml, then run As-maven build-





Maven+tomcat+eclipse Hot Deployment

Related Article

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.