[英]Remote deploy to tomcat
I would like to deploy an application (war) using maven into remote tomcat (v7) preserving the existing context.xml - or it would be also ok to deploy the context.xml with the war. 我想使用Maven将应用程序(war)部署到保留现有context.xml的远程tomcat(v7)中,否则也可以在war中部署context.xml。 I think it is a classic issue that if you want to redeploy to tomcat through the manager it performs an undeploy and a deploy sequentilly - which undeploys context.xml as a side effect and then the application cannot start.
我认为这是一个经典的问题,如果您想通过管理器重新部署到tomcat,它将执行一次取消部署和一个后续部署-取消部署context.xml作为副作用,然后应用程序将无法启动。
What I already tried: 我已经尝试过的
I'm thinking about writing a simple ssh script (stop-tomcat, copy-war, start-tomcat) or an alternative manager script, but first I wanted to ask you before reinvent the wheel. 我正在考虑编写一个简单的ssh脚本(stop-tomcat,copy-war,start-tomcat)或其他管理器脚本,但是首先我想问一下您是否要重新发明轮子。 I saw solutions using 'tomcat7-maven-plugin', but heard that it works only on local tomcat.
我看到了使用“ tomcat7-maven-plugin”的解决方案,但听说它仅适用于本地tomcat。 I do not insist on getting a full-fledged maven solution: if you suggest a solution using the manager with simple REST calls, I can implement also, in maven.
我并不坚持要获得成熟的Maven解决方案:如果您建议使用带有简单REST调用的管理器的解决方案,我也可以在Maven中实现。
So the question splits into three possible solutions (under tomcat7): 因此,问题分为三个可能的解决方案(在tomcat7下):
Do you know a reliable solution for that? 您知道可靠的解决方案吗?
At last I came out with a not-nice-but-working solution running a script which: - logs in to tomcat machine - stops the instance - cleanup webapps directory - download the wars into webapps directory - start the instance 最后,我提出了一个运行脚本的非但不错的解决方案:-登录tomcat计算机-停止实例-清理webapps目录-将wars下载到webapps目录中-启动实例
Again: the issue does not exist in tomcat 6 and 8 :-) 同样:tomcat 6和8中不存在此问题:-)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.