Windows publishes web to Tomcat in batch and starts Tomcat script sharing

Time:2019-11-13

Copy codeThe code is as follows:
@ECHO OFF
@REM deploy web system to Tomcat
set date=%date:~0,10%
set time=%time:~0,8%
set currDate=%date% %time%
Echo starts running. Copy the compiled code in the workspace to Tomcat…% currDate%

Echo setting parameters
Set work space = J: \ float \ it \ workspace
set PRJ_NAME=MyStruts1Prj
set PRJ_WEB_ROOT=MyStruts1Prj\WebContent
set BIN=build
Set Catalina? Home = J: \ floating \ it \ tools \ Tomcat6? 0? 3? 5
set WEB_NAME=webapp

@REM delete previous
Echo delete the existing
cd %CATALINA_HOME%\webapps
if exist %WEB_NAME% rd /s /q %WEB_NAME%

@REM NEW
md %WEB_NAME%

@REM copies the compiled files from the project to Tomcat
Echo copy the compiled files from the project to Tomcat \ webapps
xcopy %WORK_SPACE%\%PRJ_WEB_ROOT% %CATALINA_HOME%\webapps\%WEB_NAME% /S /E /F /A
xcopy %WORK_SPACE%\%PRJ_NAME%\%BIN% %CATALINA_HOME%\webapps\%WEB_NAME%\WEB-INF /S /E /F /A

@REM starts Tomcat
Echo starts Tomcat
cd %CATALINA_HOME%\bin
call startup.bat