部署maven web工程到外部服务器
<role rolename="manager-gui"/><role rolename="manager-script"/><user username="****" password="****" roles="manager-gui,manager-script"/>
?访问 http://localhost:8080 在 Manager App 打开 输入用户名和密码,验证成功,说明配置成功。
?
2、%MAVNE_HOME%/conf/settings.xml 配置servers节点
?
<servers><id>tomcat7</id> <username>****</username> <password>****</password> </servers>
?*****是tomcat配置的用户名和密码
?
3、配置maven web工程build属性。主要是tomcat7-maven-plugin,如果是tomcat6的话,用tomcat6-maven-plugin
?
<build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><configuration><source>${java-version}</source><target>${java-version}</target></configuration><version>3.1</version></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-war-plugin</artifactId><configuration><warName>igold-0.0.1-SNAPSHOT</warName></configuration><version>2.1.1</version></plugin><plugin><groupId>org.codehaus.mojo</groupId><artifactId>tomcat-maven-plugin</artifactId><version>1.1</version></plugin><plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.1</version><configuration><url>http://localhost:8080/manager/text</url><server>tomcat7</server><username>****</username><password>****</password></configuration></plugin></plugins></build>
?
?4、启动tomcat7,回到eclipse,先install maven web工程,打包为war包。最后build,run as --> maven build --> tomcat7:deploy
?
THE END
?