首页 > tomcat设置unpackWARs=true, war包不更新

tomcat设置unpackWARs=true, war包不更新

就是自动部署的问题,tomcat 6.x 7.x 默认情况下设置unpackWARs=true, autoDeploy=true,
拷贝war到webapp下面,tomcat自动解压并部署,但是如果在停掉tomcat时,拷贝新的war包过去,再启动,我期待tomcat会发现这个新的war包并解压后覆盖旧的目录,但是实际上他不会根据新的war包再部署,而是直接使用之前解压过的目录,所以没有更新,我跟了下源码,也是这样。
然而tomcat官方文档描述的是:
启动时会先检查应用目录,如果有与之关联的、更新的war包存在时,会重新部署这个war包;

实际情况和文档不一致,有人知道这个问题么?


If you redeploy an updated WAR file, be sure to delete the expanded directory when restarting Tomcat, so that the updated WAR file will be re-expanded (note that the auto deployer, if enabled, will automatically expand the updated WAR file once the previously expanded directory is removed).
https://tomcat.apache.org/tomcat-5.5-doc/config/host.html#Automatic Application Deployment

【热门文章】
【热门文章】