maven - 如何使用 maven-tomcat-plugin 在远程 Tomcat 7 上重新部署 war

标签 maven tomcat7 maven-tomcat-plugin

我正在尝试使用 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/

相关文章:

java - Jenkins 在多个操作系统上进行集成测试

java - 运行时构建失败 "mvn clean install"

spring - tomcat7 maven 插件无法访问 src/main/resources 中的资源?

java - Maven 多模块不重新加载资源

java - Maven 无法解析 C3P0 依赖项

Maven cxf 插件错误

java.util.MissingResourceException : Can't find bundle for base name com. sun.org.apache.xerces.internal.impl.msg.SAXMessages,区域设置 en_US

eclipse - ubuntu中的apache Tomcat安装目录/在eclipse + ubuntu中配置Tomcat

java - 无法使用tomcat7重新加载服务器

maven - 使用 tomcat-maven-plugin 将单个 war 部署到多个 tomcat