Eclipse-maven Integrated TOMCAT7 Thermal Deployment project

Source: Internet
Author: User

The Maven Tomcat plugin is now mostly available in two versions, Tomcat-maven-plugin and Tomcat7-maven-plugin, in the same way, please look down.

Note: You first Configure the administrative users and permissions for Tomcat.

Open the Tomcat-users.xml file and add it later

<role rolename= "Manager-gui"/>

<role rolename= "Manager-script"/>

<user password= "123456" roles= "Manager-gui,manager-script" username= "admin"/>

Tomcat7-maven-plugin use

Configuration

Two plug-ins using the same method, the same need to reference the plug-in pom.xml, need to add the following configuration

<build>
<finalName>myproject</finalName>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://192.168.159.128/manager/text</url>
<path>/</path>
<server>tomcat</server>
<username>admin</username>
<password>123456</password>
</configuration>
</plugin>
</plugins>
</build>

Plug-in use

Briefly describe:

Path is the way to access the app

Port is the port number of Tomcat

Uriencoding URL by UTF-8 encoding, this solves the Chinese parameter garbled.

The Server specifies the tomcat name.

The configuration is so simple, basically fixed, below to see how to use.

Plugin Run

If eclipse installs the Maven plugin, select the project, right-click and select Run as--> maven build.

If this is the first time, the following dialog box will pop up. Add the following command to the Goals box: Tomcat:run

This will allow the Tomcat plug-in to run.

Here are a few common goal

Command Describe
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

Note here that the plug-in naming method is somewhat different, such as starting Tomcat, the corresponding target command is: Tomcat7:run, the others need to be changed to: TOMCAT7,

The configuration is so simple that if you need to trace the dubug in Tomcat, you can start the MAVEN command in the same way.

Eclipse-maven Integrated TOMCAT7 Thermal Deployment project

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.