Windows dos命令执行maven编译命令、复制war包到Tomcat、启动Tomcat
rem dos clean install rem author iss002 set "batHome=C:\Users\DELL\Desktop" set "zcHome=E:\git-zc\jxgyl-trading-all" set "zcTomcatHome=F:\zc-tomcat" rem stop the tomcats F: cd %zcTomcatHome%\tomcat-admin-service\bin call shutdown.bat -force rem sleep some seconds ping -n 3 127.1 >nul cd %zcTomcatHome%\tomcat-admin-web\bin call shutdown.bat -force ping -n 3 127.1 >nul cd %zcTomcatHome%\tomcat-goods-category\bin call shutdown.bat -force ping -n 3 127.1 >nul cd %zcTomcatHome%\tomcat-trading-portal\bin call shutdown.bat -force ping -n 3 127.1 >nul cd %zcTomcatHome%\tomcat-trading-service\bin call shutdown.bat -force
ping -n 3 127.1 >nul E: cd git-zc\jxgyl-trading-all\trading-parent rem do not let progress stop when using 'call' command call mvn clean install -Dmaven.test.skip=true cd .. call mvn clean install -Dmaven.test.skip=true goto rd-tomcat-admin-service :rd-tomcat-admin-service if not exist "%zcTomcatHome%\tomcat-admin-service\webapps" goto rd-tomcat-admin-web rd /s/q %zcTomcatHome%\tomcat-admin-service\webapps\ echo Remove tomcat-admin-service's 'webapps' folder :rd-tomcat-admin-web if not exist "%zcTomcatHome%\tomcat-admin-web\webapps" goto rd-tomcat-goods-category rd /s/q %zcTomcatHome%\tomcat-admin-web\webapps\ echo Remove tomcat-admin-web's 'webapps' folder :rd-tomcat-goods-category if not exist "%zcTomcatHome%\tomcat-goods-category\webapps" goto rd-tomcat-trading-portal rd /s/q %zcTomcatHome%\tomcat-goods-category\webapps\ echo Remove tomcat-goods-category's 'webapps' folder :rd-tomcat-trading-portal if not exist "%zcTomcatHome%\tomcat-trading-portal" goto rd-tomcat-trading-service rd /s/q %zcTomcatHome%\tomcat-trading-portal\webapps\ echo Remove tomcat-trading-portal's 'webapps' folder :rd-tomcat-trading-service if not exist "%zcTomcatHome%\tomcat-trading-service\webapps" goto md-tomcat-admin-service rd /s/q %zcTomcatHome%\tomcat-trading-service\webapps\ echo Remove tomcat-trading-service's 'webapps' folder :md-tomcat-admin-service if exist "%zcTomcatHome%\tomcat-admin-service\webapps" goto md-tomcat-admin-web md %zcTomcatHome%\tomcat-admin-service\webapps echo Mkdir tomcat-admin-service's 'webapps' :md-tomcat-admin-web if exist "%zcTomcatHome%\tomcat-admin-web\webapps" goto md-tomcat-goods-category md %zcTomcatHome%\tomcat-admin-web\webapps echo Mkdir tomcat-admin-web's 'webapps' :md-tomcat-goods-category if exist "%zcTomcatHome%\tomcat-goods-category\webapps" goto md-tomcat-trading-portal md %zcTomcatHome%\tomcat-goods-category\webapps echo Mkdir tomcat-goods-category's 'webapps' :md-tomcat-trading-portal if exist "%zcTomcatHome%\tomcat-trading-portal\webapps" goto md-tomcat-trading-service md %zcTomcatHome%\tomcat-trading-portal\webapps echo Mkdir tomcat-trading-portal's 'webapps' :md-tomcat-trading-service if exist "%zcTomcatHome%\tomcat-trading-service\webapps" goto execmove md %zcTomcatHome%\tomcat-trading-service\webapps echo Mkdir tomcat-trading-service's 'webapps' :execmove copy %zcHome%\admin\service\admin-category-service\target\admin-category-service.war %zcTomcatHome%\tomcat-admin-service\webapps\ copy %zcHome%\admin\service\admin-contract-service\target\admin-contract-service.war %zcTomcatHome%\tomcat-admin-service\webapps\ copy %zcHome%\admin\service\admin-member-service\target\admin-member-service.war %zcTomcatHome%\tomcat-admin-service\webapps\ copy %zcHome%\admin\service\admin-portal-service\target\admin-portal-service.war %zcTomcatHome%\tomcat-admin-service\webapps\ copy %zcHome%\admin\service\admin-settlement-service\target\admin-settlement-service.war %zcTomcatHome%\tomcat-admin-service\webapps\ copy %zcHome%\admin\service\admin-trading-service\target\admin-trading-service.war %zcTomcatHome%\tomcat-admin-service\webapps\ echo Copy 'adming-*-service\target\*.war' to 'tomcat-*-service\webapps' copy %zcHome%\admin\web\admin-category-web\target\admin-category-web.war %zcTomcatHome%\tomcat-admin-web\webapps\ copy %zcHome%\admin\web\admin-contract-web\target\admin-contract-web.war %zcTomcatHome%\tomcat-admin-web\webapps\ copy %zcHome%\admin\web\admin-member-web\target\admin-member-web.war %zcTomcatHome%\tomcat-admin-web\webapps\ copy %zcHome%\admin\web\admin-portal-web\target\admin-portal-web.war %zcTomcatHome%\tomcat-admin-web\webapps\ copy %zcHome%\admin\web\admin-settlement-web\target\admin-settlement-web.war %zcTomcatHome%\tomcat-admin-web\webapps\ copy %zcHome%\admin\web\admin-trading-web\target\admin-trading-web.war %zcTomcatHome%\tomcat-admin-web\webapps\ echo Copy 'adming-*-web\target\*.war' to 'tomcat-*-web\webapps' copy %zcHome%\customer\trading-category\target\trading-category.war %zcTomcatHome%\tomcat-goods-category\webapps\ copy %zcHome%\customer\trading-portal\target\trading-portal.war %zcTomcatHome%\tomcat-trading-portal\webapps\ copy %zcHome%\customer\trading-portal-lookandfeel\target\trading-portal-lookandfeel.war %zcTomcatHome%\tomcat-trading-portal\webapps\ copy %zcHome%\customer\trading-service\target\trading-service.war %zcTomcatHome%\tomcat-trading-service\webapps\ echo Copy 'customer\target\*.war' to 'customer\webapps\' F: cd %zcTomcatHome%\tomcat-admin-service\bin call catalina.bat jpda start ping -n 6 127.1 >nul cd %zcTomcatHome%\tomcat-admin-web\bin call catalina.bat jpda start ping -n 6 127.1 >nul cd %zcTomcatHome%\tomcat-goods-category\bin call catalina.bat jpda start ping -n 6 127.1 >nul cd %zcTomcatHome%\tomcat-trading-service\bin call catalina.bat jpda start ping -n 6 127.1 >nul cd %zcTomcatHome%\tomcat-trading-portal\bin call catalina.bat jpda start