的pom.xml:行家tomcat7部署
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://localhost:8080/manager/html</url>
<server>myserver</server>
<path>/test</path>
<warFile>${project.build.directory}/${project.build.finalName}.war</warFile>
</configuration>
</plugin>
Eclipse的使用:的Eclipse靛藍3.7與M2E插件
改性 Tomcat7/CONF/Tomcat的users.xml中
<role rolename="admin"/>
<role rolename="manager"/>
<user username="admin" password="admin" roles="admin,manager"/>
</tomcat-users>
的context.xml Tomcat7/conf/context.xml文件,更改下<context>
到
<Context antiJARLocking="true" antiResourceLocking="true">
Apache的行家\的conf \ settings.xml的
添加以下下的服務器標籤條目:
<servers>
<server>
<id>myserver</id>
<username>admin</username>
<password>admin</password>
</server>
啓動tomcat服務器。
目標運行:tomcat的:部署和tomcat的:取消部署
收到以下錯誤:
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy (default-cli) on project test: Cannot invoke Tomcat manager: Server returned HTTP response code: 403 for URL: http://localhost:8080/manager/html/deploy?path=%2Ftest&war=&update=true -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
項目名稱:測試
戰爭文件名:test-1.0-SNAPSHOT.war
類似的問題找到,但因此未得到多大用處:Tomcat-maven-plugin 401 error
當你訪問這個URL:'http:// localhost:8080/manager/html'時,你是否加載了一個頁面? –
不,它說403錯誤msg – TechFind