I added following setting in tomcat's configuration file server.xml.
<Context docBase="path/to/war/abc.war" path="abc"/>
Startup tomcat, tomcat will unpack abc.war to webapps/abc.
Then I use build tools to generate new version of abc.war, new abc.war will overwrite old abc.war file.
Stop tomcat, restart it again. New abc.war is not get deployed. Is there a configuration for tomcat to redeploy war files every time?
Although, There is a workaround, delete webapps/abc folder every time before starting up tomcat.
Set unpackWar=true in the context.xml
Auto deploy feature of Tomcat should setup at Host configuration, for axample
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
Read more at this link Tomcat Automatic_Application_Deployment
<Context docBase="path/to/war/abc.war" path="abc" unpackWar="false"/>
I added unpackWar="false"
in Context tag. This property will let Tomcat deploy the war file every time in my environment. This will deploy the application in ${TOMCAT_HOME}/work folder instead of $(TOMCAT_HOME}/webapps folder.
It works for me. By the way I am using Tomcat-7.0.56.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.