[英]How to configure tomcat to redeploy war every time?
I added following setting in tomcat's configuration file server.xml. 我在tomcat的配置文件server.xml中添加了以下设置。
<Context docBase="path/to/war/abc.war" path="abc"/>
Startup tomcat, tomcat will unpack abc.war to webapps/abc. 启动tomcat,tomcat会将abc.war解压缩到webapps / abc。
Then I use build tools to generate new version of abc.war, new abc.war will overwrite old abc.war file. 然后,我使用构建工具生成新版本的abc.war,新的abc.war将覆盖旧的abc.war文件。
Stop tomcat, restart it again. 停止tomcat,然后重新启动。 New abc.war is not get deployed.
未部署新的abc.war。 Is there a configuration for tomcat to redeploy war files every time?
Tomcat是否有配置可以每次重新部署War文件?
Although, There is a workaround, delete webapps/abc folder every time before starting up tomcat. 尽管有一种解决方法,但是每次启动tomcat之前都要删除webapps / abc文件夹。
Set unpackWar=true in the context.xml 在context.xml中设置unpackWar = true
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
Auto deploy feature of Tomcat should setup at Host configuration, for axample Tomcat的自动部署功能应在主机配置中设置(例如)
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
Read more at this link Tomcat Automatic_Application_Deployment 在此链接中了解更多信息Tomcat Automatic_Application_Deployment
<Context docBase="path/to/war/abc.war" path="abc" unpackWar="false"/>
I added unpackWar="false"
in Context tag. 我在Context标签中添加了
unpackWar="false"
。 This property will let Tomcat deploy the war file every time in my environment. 此属性将使Tomcat每次在我的环境中部署war文件。 This will deploy the application in ${TOMCAT_HOME}/work folder instead of $(TOMCAT_HOME}/webapps folder.
这会将应用程序部署在$ {TOMCAT_HOME} / work文件夹中,而不是$(TOMCAT_HOME} / webapps文件夹中。
It works for me. 这个对我有用。 By the way I am using Tomcat-7.0.56.
顺便说一句,我正在使用Tomcat-7.0.56。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.