maven 打包自动部署到tomcat7

配置 pom.xml

			<plugin>
				<groupId>org.apache.tomcat.maven</groupId>
				<artifactId>tomcat7-maven-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<url>http://10.9.16.150:8080/manager/text</url>
					<server>TomcatServer</server>
					<username>admin</username>
					<password>admin123</password>
				</configuration>
			</plugin>

配置tomcat-user.xml

<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="admin123" roles="manager-gui,manager-script" />



配置mavne 的 setting.xml

		<server>
		<id>TomcatServer</id>
		<username>admin</username>
		<password>admin123</password>
		</server>


#第一次发布 
tomcat7:deploy
#再次发布 
tomcat7:redeploy

猜你喜欢

转载自gangling.iteye.com/blog/2305554