Steps: gradle resolveDeps gradle build sudo rm -rf /var/lib/tomcat9/webapps/demo* sudo cp build/libs/demo.war /var/lib/tomcat9/webapps/ sudo systemctl restart tomcat9