本机上安装了TOMCAT7, MAVEN3. 要使用MVN DEPLOY命令来部署项目,需要作如下配置:
1. TOMCAT的配置 (tomcat-users.xml)
2. pom.xml的配置:
备注: server.xml中将默认端口配置为80
1. TOMCAT的配置 (tomcat-users.xml)
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="username" password="pwd" roles="tomcat, manager-gui, manager-script"/>
2. pom.xml的配置:
<build>
<plugins>
<!-- Maven Tomcat Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://localhost/manager/text</url>
<username>username</username>
<password>pwd</password>
<path>/yourContext</path>
</configuration>
</plugin>
<!-- Maven compiler plugin -->
</plugins>
</build>
备注: server.xml中将默认端口配置为80