versions.bat
756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
@echo off
rem /**
rem * Copyright © 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
rem *
rem * Author: ThinkGem@163.com
rem */
echo.
echo [信息] 更新项目版本号。
echo.
rem pause
echo.
cd %~dp0
set /p new=请输入新版本号:
echo.
pause
echo.
cd ..
rem 更新pom版本号
call mvn versions:set -DnewVersion=%new%
rem 替换 jeesite.properties 中的版本号
echo.
set f=%cd%\src\main\resources\jeesite.properties
echo [INFO] Update %f%
set s1=version=
set s2=version=V%new%
for /f "delims=:" %%a in ('findstr /in "%s1%" "%f%"') do set n=%%a
(for /f "tokens=1* delims=:" %%a in ('findstr /n ".*" "%f%"') do (
if %%a equ %n% ( echo.%s2%) else ( echo.%%b)
))>newfile
echo.
move newfile "%f%" >nul
echo.
cd bin
pause