Automatically deploy war on tomcat6 using Maven

Source: Internet
Author: User

Maven automatically deploys war to Tomcat

Software Versions: tomcat6 and maven3

1. Configure the following information in the pom of the Maven project:

<Build>

<Finalname> spring_web </finalname>

<Plugins>

<Plugin>

<Groupid> org. codehaus. Mojo </groupid>

<Artifactid>Tomcat-Maven-Plugin</Artifactid>

<Version> 1.1 </version>

<Configuration>

<URL> http: // localhost: 8080/manager </URL>

<Username> admin </username>

<Password> admin </password>

<Path>/spring_web </path>

</Configuration>

<Executions>

<Execution>

<ID>Tomcat-Deploy </ID>

<Phase> deploy </phase>

<Goals>

<Goal> deploy </goal>

</Goals>

</Execution>

</Executions>

</Plugin>

</Plugins>

</Build>

2. Add the following information in the Tomcat tomcat-users.xml

<Rolerolename = "manager"/>

<Userusername = "admin" Password = "admin" roles = "manager"/>

3. start Tomcat

 

4. Run Maven build...

 

5. Check the files under Tomcat's webapps to see if there are two more files, spring_web.war.

Or enter the URL of your project, for example, http: // localhost: 8080/spring_web /.

If yes, it is successful!

Automatically deploy war on tomcat6 using Maven

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.