http://xmfxue.blog.163.com/blog/static/109643150201141504115683/
http://stackoverflow.com/questions/13336816/tomcat7-maven-plugin-tomcatmanager-status-code403-reasonphraseforbbiden
第一種方法:修改tomcat目錄下的server.xml文件,在<host>結點加入
</Context>
第二種方法:把用maven生成的.war包放到tomcat的webapps目錄下,或者把生成的web項目文件放到tomcat的webapps目錄下,這個應該是最基本的方法啦~
第三種方法:在tomcat/conf/Catalina/localhost目錄下,建立一個可以取任意名的.xml文件,內容與第一種方法的一樣:
</Context>
第四種是使用myeclipse的deploy功能發佈,也挺方便的。
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="manager" password="manager" roles="manager"/>
<user username="admin" password="admin" roles="manager-script"/>
</tomcat-users>
<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>myserver</server>
</configuration>
</plugin>
</plugins>
</build>
<id>myserver</id>
<username>manager</username> <!-- tomcat的manager用戶名,見上面的tomcat-users.xml文件 -->
<password>manager</password> <!-- tomcat的manager用戶登錄的密碼 -->
</server>
<finalName>mycontext</finalName>
</build>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<path>/mycontext</path>
</configuration>
</plugin>