我正在尝试使用 Windows 中的命令提示符将 war 从我的本地机器重新部署到远程 Tomcat 7。我第一次能够使用 tomcat-maven-plugin 上传 war ,但随后的上传给了我这样的消息。
pom.xml
<!-- Deploy to Remote Tomcat -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>${unix.tomcat.url}</url>
<server>sandbox-tomcat</server>
<path>/${project.artifactId}</path>
</configuration>
</plugin>
Maven 命令:
mvn tomcat7:redeploy
Maven 日志:
[INFO] Deploying war to http://secdevapp11.gspt.net:8080/istore-tax-service
Uploading: http://secdevapp11.gspt.net:8080/manager/text/deploy?path=%2Fistore-tax-service&update=true
Uploaded: http://secdevapp11.gspt.net:8080/manager/text/deploy?path=%2Fistore-tax-service&update=true (1334 KB at 512.7 KB/sec)
[INFO] tomcatManager status code:200, ReasonPhrase:OK
[INFO] FAIL - Unable to delete [/nfs/home_04/chandeln/installations/apache-tomcat-7.0.52/webapps/istore-tax-service]. The continued presence of this file may cause problems.
[INFO] FAIL - Application already exists at path /istore-tax-service
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.704s
[INFO] Finished at: Wed Mar 26 15:34:55 EDT 2014
[INFO] Final Memory: 21M/224M
[INFO] ------------------------------------------------------------------------
最佳答案
我也有这个问题。
对我来说,它可以在 tomcat-plugin 中放入更新标签
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
...
<update>true</update>
...
并再次使用 tomcat7:deploy 命令(而不是“重新部署”)。
(刚刚注意到答案仍然存在......,抱歉复制)
关于maven - 如何使用 maven-tomcat-plugin 在远程 Tomcat 7 上重新部署 war ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22671420/