怎么将maven工程部署到服务器上

展开全部pom配置Java代码<plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.1</version><configuration><url>:8080/manager/text</url><server>server203</server><path>/energy</path></configuration></plugin> setting.xmlJava代码<server><id>unknown</id><username>tomcat</username><password>tomcat</password></server> tomcat配置有管理权限的用户:conf\tomcat-users.xml Java代码<?xml version=1.0 encoding=utf-8?><tomcat-users><role rolename="manager"/><user username="marshal" password="password" roles="manager"/></tomcat-users> 相关命令 运行打包部署: Java代码mvn tomcat:deploy撤销部署: Java代码mvn tomcat:undeploy启动web应用: Java代码mvn tomcat:start停止web应用: Java代码mvn tomcat:stop重新部署: Java代码mvn tomcat:redeploy部署展开的文件: Java代码mvn war:exploded tomcat:exploded自动部署脚本Java代码echo [Step 1] tomcat7:undeploy call mvn tomcat7:undeploy if errorlevel 1 goto errorecho [Step 1] tomcat7:undeploy call mvn tomcat7:deploy-Dmaven.test.skip=trueif errorlevel 1 goto errorgoto end:errorecho Error Happen!!:end 本配置仅适用tomcat7的maven插件,tomcat6请修改配置