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