Check if application is deployed in Tomcat using gradle

时光总嘲笑我的痴心妄想 提交于 2019-12-13 01:14:34

问题


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?


回答1:


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?



来源:https://stackoverflow.com/questions/28872606/check-if-application-is-deployed-in-tomcat-using-gradle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!