forked from kiegroup/droolsjbpm-build-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmvn-all.bat
68 lines (57 loc) · 1.89 KB
/
mvn-all.bat
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
@echo off
rem Runs a mvn command on all droolsjbpm repositories.
call :initializeWorkingDirAndScriptDir
if "%*" == "" (
echo.
echo Usage:
echo %~n0%~x0 [arguments of mvn]
echo For example:
echo %~n0%~x0 --version
echo %~n0%~x0 -DskipTests clean install
echo %~n0%~x0 -Dfull clean install
echo.
goto:eof
)
rem set startDateTime='date +%s'
set droolsjbpmOrganizationDir="%scriptDir%\..\.."
cd %droolsjbpmOrganizationDir%
for /F %%r in ('type %scriptDir%\repository-list.txt') do (
echo.
if exist %droolsjbpmOrganizationDir%\%%r (
echo ===============================================================================
echo Repository: %%r
echo ===============================================================================
cd %%r
if exist "%M3_HOME%\bin\mvn.bat" (
call "%M3_HOME%\bin\mvn.bat" %*
set returnCode=%ERRORLEVEL%
) else (
call mvn %*
set returnCode=%ERRORLEVEL%
)
cd ..
if "%returnCode%" neq "0" (
echo maven failed: %returnCode%
goto :end
)
) else (
echo ===============================================================================
echo Missing Repository: %%r. Skipping
echo ===============================================================================
)
)
:end
rem set endDateTime='date +%s'
rem set spentSeconds='expr %endDateTime% - %startDateTime%'
cd %workingDir%
echo.
echo Total time: %spentSeconds%s
goto:eof
:initializeWorkingDirAndScriptDir
rem Set working directory and remove all symbolic links
FOR /F %%x IN ('cd') DO set workingDir=%%x
rem Go the script directory
for %%F in (%~f0) do set scriptDir=%%~dpF
rem strip trailing \
set scriptDir=%scriptDir:~0,-1%
goto:eof