您好我正在尝试使用 Maven 部署我的应用程序。通过 web 界面部署炒锅。但是 maven 首先取消部署应用程序(这是正确的),然后在日志消息“已上传”处停止 ca.30 秒并失败:
tomcat7:部署
[INFO] Deploying war to http://192.168.1.137:8080/Application
Uploading: http://192.168.1.137:8080/manager/html/deploy?path=%2FApplication&update=true
Uploaded: http://192.168.1.137:8080/manager/html/deploy?path=%2FApplication&update=true (17575 KB at 23215.6 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 57.061s
[INFO] Finished at: Mon Aug 06 09:41:27 CEST 2012
[INFO] Final Memory: 19M/220M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.0-beta-1:deploy (default-cli) on project Application: Cannot invoke Tomcat manager: The target server failed to respond -> [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
我的 pom.xml 中的配置
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<url>http://192.168.1.137:8080/manager/html</url>
<username>admin</username>
<password>password</password>
<path>/Application</path>
<update>true</update>
</configuration>
</plugin>
我还尝试了使用 tomcat:redeploy 的旧插件:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://192.168.1.137:8080/manager/html</url>
<username>admin</username>
<password>password</password>
<path>/Application</path>
</configuration>
</plugin>
但它也失败了:
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy (default-cli) on project Application: Cannot invoke Tomcat manager: Unexpected end of file from server -> [Help 1]
是否可以更改部署的超时时间?也许我的应用程序需要很长时间才能启动
编辑:我发现当我签出项目并在运行 tomcat 的同一台机器上运行 tomcat7:deploy 时,它可以工作