利用maven插件自动部署war包到tomcat

更新pom文件

<plugin>

   <groupId>org.apache.tomcat.maven</groupId>

   <artifactId>tomcat7-maven-plugin</artifactId>

   <version>2.2</version>

   <configuration>

       <url>http://remotehost:8080/manager/text</url>

       <server>RemoteTomcatServer</server>

       <path>/</path>

   </configuration>

</plugin>

 

更新.m2/settings.xml文件

<servers>

   <server>

      <id>RemoteTomcatServer</id>

      <username>admin</username>

      <password>password</password>

   </server>

 

</servers>

 

运行mvn tomcat7:deploy 或者 mvn tomcat7:redeploy,编译并上传war文件到tomcat

猜你喜欢

转载自iwelcomeyou.iteye.com/blog/2142814