-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.bat
59 lines (42 loc) · 1.63 KB
/
run.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
rem Build and run (without tests)
rem just skip tests execution; this also gives some warnings about what versions you can use each flag with
rem mvn clean package -DskipTests
rem this skip compilation tests as well as execution
rem mvn clean package -Dmaven.test.skip=true
rem mvn clean package -Dmaven.test.skip
cls
@echo off
chcp 1251
set "LANG=ru_RU.UTF-8"
set "LANGUAGE=ru"
set "LC_CTYPE=ru_RU.UTF-8"
set "TZ=UTC"
set "CURRENT_DIR=%~dp0"
set "SCRIPT=%0"
set "FUNCTION=%CURRENT_DIR%common_functions.bat"
call "%FUNCTION%" fnc_log "Started: %SCRIPT%"
set "PROJ_DIR=%CURRENT_DIR%.."
set "POM_FILE=%PROJ_DIR%\pom.xml"
call "%FUNCTION%" fnc_clean_temp_files &
call "%FUNCTION%" fnc_log "temp files removed successfully" &
call mvn -f "%POM_FILE%" clean package -DskipTests &
call "%FUNCTION%" fnc_log "maven done successfully"
set "TARGET_DIR=%PROJ_DIR%\target"
set "JAR_FILE=%TARGET_DIR%\vehicle-*.jar"
rem getting the full name of jar-file
for %%f in ("%JAR_FILE%") do (
set "JAR_FILE=%TARGET_DIR%\%%~nxf"
)
set "JAVA_OPTS=-Xmx1024m"
set "JAVA_OPTS=%JAVA_OPTS% -Xms256m"
set "JAVA_OPTS=%JAVA_OPTS% -XX:-OmitStackTraceInFastThrow"
set "JAVA_CMD=java %JAVA_OPTS% -jar ^"%JAR_FILE%^""
%JAVA_CMD% &
call "%FUNCTION%" fnc_log "%JAR_FILE% started successfully" &
call "%FUNCTION%" fnc_clean_temp_files &
call "%FUNCTION%" fnc_log "temp files removed successfully" &
pause &
exit 0
call "%FUNCTION%" fnc_log "run of %JAR_FILE% failed" &
pause &
exit 1