检查应用程序是否使用gradle部署在Tomcat中 [英] Check if application is deployed in Tomcat using gradle
问题描述
我使用 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 $ c $
$ <$>并使用这些任务的适当组合:例如也许使用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 callcargoUndeployRemote
andcargoDeployRemote
afterwards?这篇关于检查应用程序是否使用gradle部署在Tomcat中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!