Tomcat not autodeploying war file

前端 未结 6 1268
隐瞒了意图╮
隐瞒了意图╮ 2021-01-31 08:56

I followed the following steps

  • Shutdown Tomcat
  • Deployed a war file with a timestamp of 1st December
  • Start Tomcat - This created the exploded dire
6条回答
  •  余生分开走
    2021-01-31 09:30

    As I use maven to generate my builds in tomcat inside a ubuntu box, I have a script called

    install_wars.sh

    With the following content:

    mvn clean install
    service tomcat7 stop
    find /var/lib/tomcat7/webapps/ -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \;
    find . -name *.war -exec cp {} /var/lib/tomcat7/webapps/ \;
    service tomcat7 start
    

    You may want to change the path and maven commands accordingly.

    The tomcat stop/start are there to avoid any memory leaks that can make the application slow after several redeploys.

提交回复
热议问题