检查应用程序是否使用gradle部署在Tomcat中 [英] Check if application is deployed in Tomcat using gradle

查看:260
本文介绍了检查应用程序是否使用gradle部署在Tomcat中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 gradle-cargo 插件将我的战争部署到tomcat服务器上。 我打电话给 cargoDeployRemote 任务。但是,当应用程序已经部署在服务器上时,它会引发错误。

 部署[C:\jenkins\workspace\myapp\build\libs\myapp.war] 
:cargoDeployRemote FAILED
:cargoDeployRemote(Thread [main,5,main])已完成。花了1.081秒。

失败:构建失败,出现异常。

*出错:
任务':cargoDeployRemote'的执行失败。
...
...
BUILD FAILED

过来这个?有没有一种方法可以查询上下文url并找到它是否已经部署? 解决方案

在引用 docs 我会研究以下任务的工作原理:




  • cargoDeployRemote

  • cargoUndeployRemote











    $ <$>并使用这些任务的适当组合:例如也许使用 cargoRedeployRemote 会解决问题吗?或者,也可以调用 cargoUndeployRemote cargoDeployRemote 之后?


    I am using gradle-cargo plugin to deploy my war to tomcat server.

    I call cargoDeployRemote task for this. However it throws me an error when the application is already deployed on the server.

    Deploying [C:\jenkins\workspace\myapp\build\libs\myapp.war]
    :cargoDeployRemote FAILED
    :cargoDeployRemote (Thread[main,5,main]) completed. Took 1.081 secs.
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':cargoDeployRemote'.
    ...
    ...
    BUILD FAILED
    

    How to over come this? Is there a way where I can query the context url and find if it is already deployed?

    解决方案

    After referring to the docs I'd investigate how exactly the following tasks work:

    • cargoDeployRemote
    • cargoUndeployRemote
    • cargoRedeployRemote

    And use appropriate combination of these tasks: e.g. maybe using cargoRedeployRemote will solve the problem? Or maybe call cargoUndeployRemote and cargoDeployRemote afterwards?

    这篇关于检查应用程序是否使用gradle部署在Tomcat中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆