tomcat7:
1.编辑tomcat下的conf/tomcat-users.xml
<role rolename="manager-gui" />
<role rolename="manager-script" />
<user username="tomcat" password="tomcat" roles="manager-gui, manager-script"/>
2.修改maven的配置
编辑maven目录下conf/settings.xml,在servers节点下添加:
<server>
<id>tomcat7</id>
<username>tomcat</username>
<password>tomcat</password>
</server>
pom中热部署插件的配置:
<!-- 配置Tomcat插件 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/${project.build.finalName}</path>
<port>8080</port>
<uriEncoding>UTF-8</uriEncoding>
<server>tomcat7</server>
<username>tomcat</username>
<password>tomcat</password>
<url>http://0.0.0.0:8080/manager/text</url>
</configuration>
</plugin>
网友评论