标签:ja
一、maven的配置
<build> <finalName>fish-web</finalName> <!-- 将项目发布到tomcat6 --> <pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> <version>1.1</version> <configuration> <!--<url>http://localhost:8080/manager</url> --> <path>/fish-web</path> <username>manager</username> <password>manager</password> <uriEncoding>UTF-8</uriEncoding> </configuration> </plugin> <!-- 将项目发布到tomcat7 --> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.1</version> <configuration> <!--<url>http://localhost:8080/manager/text</url>--> <path>/fish-web</path> <username>manager</username> <password>manager</password> <uriEncoding>UTF-8</uriEncoding> </configuration> </plugin> </plugins> </pluginManagement> </build>
二、tomcat的tomcat-users.xml的配置
<role rolename="manager"/> <role rolename="manager-gui"/> <role rolename="manager-script"/> <user username="manager" password="manager" roles="manager-gui, manager-script, manager"/>
三、执行mvn命令
tomcat 6:mvn -Dmaven.test.skip=true tomcat7:redeploy
tomcat 7:mvn -Dmaven.test.skip=true tomcat:redeploy
本文出自 “小鱼的博客” 博客,谢绝转载!
Maven 集成Tomcat插件自动发布项目到tomcat的webapps目录下
标签:ja
原文地址:http://395469372.blog.51cto.com/1150982/1774731