1. 程式人生 > 實用技巧 >Maven打包指令碼

Maven打包指令碼

指令碼檔案需注意編碼格式,Windows下是ANSI格式的,用開發工具開啟看到可能是亂碼的

@echo off
:begin
echo =====================請選擇您需要打包的專案=====================
echo 0 退出系統
echo 1 backend
echo 2 demo
echo 3 graphic
set/p a=請選擇對應的數字:
if "%a%"=="1" goto :backend
if "%a%"=="2" goto :demo
if "%a%"=="3" goto :graphic
if "%a%"=="0" goto :end
echo
\ echo 輸入的值有誤,請重新輸入 echo\ goto :begin #backend專案 :backend ::專案根目錄 cd ../ ::專案依賴模組 call mvn clean install ::容器所在目錄 cd SAND-WebApplication/backendApp ::休眠1s類似於Linux的sleep 1s ping -n 1 127.0.0.1>nul ::打包成功之後開啟target目錄 call mvn clean install && explorer target ::回到專案根目錄 cd ../ pause goto :begin #demo專案 :demo ::專案根目錄 cd ..
/ ::專案依賴模組 call mvn clean install ::容器所在目錄 cd SAND-WebApplication/demoApp ::休眠1s類似於Linux的sleep 1s ping -n 1 127.0.0.1>nul ::打包併成功之後開啟target目錄(cls是清除當前介面的打包資訊) call mvn clean install && cls && explorer target ::回到專案根目錄 cd ../ pause goto :begin #graphic專案 :graphic ::專案根目錄 cd ../ ::專案依賴模組 call mvn clean
install ::容器所在目錄 cd SAND-WebApplication/graphicApp ::休眠1s類似於Linux的sleep 1s ping -n 1 127.0.0.1>nul ::打包併成功之後開啟target目錄(cls是清除當前介面的打包資訊) call mvn clean install && cls && explorer target ::回到專案根目錄 cd ../ pause goto :begin :end exit