配置 Tocmat 用户
> vim $TOMCAT_PATH%/conf/tomcat-users.xml
<tomcat-users><role rolename="manager-gui"/><role rolename="manager-script"/><user username="tomcat" password="linuxmint" roles="manager-gui,manager-script"/>tomcat-users>
配置 maven
<server><id>tomcat7id><username>tomcatusername><password>linuxmintpassword>server>
pom.xml 基本配置
<plugins><plugin><groupId>org.apache.tomcat.mavengroupId> <artifactId>tomcat7-maven-pluginartifactId> <version>2.1version><configuration><server>tomcat7server>configuration>plugin> plugins>
也可以直接把tomcat 信息配置在 pom.xml 内.
build > plugins<plugins><plugin><groupId>org.apache.tomcat.mavengroupId><artifactId>tomcat7-maven-pluginartifactId><version>2.1version><configuration><url>http://localhost:8080/manager/texturl><path>/${project.build.finalName}path><server>tomcat7server><username>tomcatusername> <password>linuxmintpassword>configuration>plugin>plugins>
部署的 URL
tomcat6 http://localhost:8080/manager/html
tomcat7 http://localhost:8080/manager/text
部署
> mvn tomcat7:deploy
重新部署
> mvn tomcat7:redeploy