The maven deploy command usually gets errors for various reasons. if you are running a Unix / Linux system, I recommend using the rsync method on the console. (You can write your own shell script to manage easily). This not only helps to deploy without problems, but also helps to get time when redeploying (only downloading changed / new files). Since maven deploy / redeploy loads your project as a package in jar / war. However, the rysnc method loads the project files one by one.
Before using it, you must make sure that there are two conditions.
1- your project is built in the target folder (Spring Tool Suite)
2- you have access to tomcat via ssh
code example: (v_: prefix, which is a variable (configurable))
rsync -avz v_your_project_in_target root@v _ip:v_tomcat_name/webapps/v_project_name
(Second access)
source share