chcp 65001
@echo off
title 打包神器,龙爷造。
echo =============================
echo 姓名:Long
echo 日期:2020-08-29
echo =============================
echo
set current=%cd%
set common=common
set gatewary=gateway
set baseService=service-basease-service
set baseApi=service-basease-api
set appService=service-appapp-service
set appApi=service-appapp-api
set scadaService=service-scadascada-service
set scadaApi=service-scadascada-api
set storageService=service-storagestorage-service
set storageApi=service-storagestorage-api
set orderService=service-orderorder-service
set orderApi=service-orderorder-api
set scheduleService=service-scheduler
@REM 打包目标地址
set target=C:UserslongDesktop a
@REM 包名称
set gatewaryName="gateway-0.0.1-SNAPSHOT.jar"
set baseName="base-api-0.0.1-SNAPSHOT.jar"
set appName="app-api-0.0.1-SNAPSHOT.jar"
set scadaName="scada-api-0.0.1-SNAPSHOT.jar"
set storageName="storage-api-0.0.1-SNAPSHOT.jar"
set orderName="order-api-0.0.1-SNAPSHOT.jar"
set schedulerName="service-scheduler-0.0.1-SNAPSHOT.jar"
:begin
echo q 退出系统
echo common 构建common
echo gateway 构建gateway
echo base 构建base
echo app 构建app
echo scada 构建scada
echo storage 构建storage
echo order 构建order
echo schedule 构建schedule
set/p cmd=请选择执行的命令:
echo 输入命令为 %cmd%
if "%cmd%"=="common" (call :buildCommon)
if "%cmd%"=="gateway" (call :buildGateWay)
if "%cmd%"=="base" (call :buildBase)
if "%cmd%"=="app" (call :buildApp)
if "%cmd%"=="scada" (call :buildScada)
if "%cmd%"=="storage" (call :buildStorage)
if "%cmd%"=="order" (call :buildOrder)
if "%cmd%"=="schedule" (call :buildSchedule)
if "%cmd%"=="q" (call :end)
echo
echo 命令输入有误,请重新输入
echo
call :begin
:buildCommon
cd /d %common%
call mvn clean install
echo buildCommon success
goto :begin
:buildGateWay
cd /d %gatewary%
call mvn clean install
cd target
copy /y %gatewaryName% "%target%"
echo buildGateWay success
goto :begin
:buildBase
cd /d %baseService%
call mvn clean install
cd /d %baseApi%
call mvn clean install -Dmaven.test.skip=true
cd target
copy /y %baseName% "%target%"
echo buildBase success
goto :begin
:buildApp
cd /d %appService%
call mvn clean install
cd /d %appApi%
call mvn clean install -Dmaven.test.skip=true
cd target
copy /y %appName% "%target%"
echo buildApp success
goto :begin
:buildScada
cd /d %scadaService%
call mvn clean install
cd /d %scadaApi%
call mvn clean install -Dmaven.test.skip=true
cd target
copy /y %scadaName% "%target%"
echo buildScada success
goto :begin
:buildStorage
cd /d %storageService%
call mvn clean install
cd /d %storageApi%
call mvn clean install -Dmaven.test.skip=true
cd target
copy /y %storageName% "%target%"
echo buildStorage success
goto :begin
:buildOrder
cd /d %orderService%
call mvn clean install
cd /d %orderApi%
call mvn clean install -Dmaven.test.skip=true
cd target
copy /y %orderName% "%target%"
echo buildOrder success
goto :begin
:buildSchedule
cd /d %scheduleService%
call mvn clean install -Dmaven.test.skip=true
cd target
copy /y %schedulerName% "%target%"
echo buildSchedule success
goto :begin
:end exit