-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecute.bat
More file actions
40 lines (32 loc) · 1.02 KB
/
execute.bat
File metadata and controls
40 lines (32 loc) · 1.02 KB
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
setlocal enabledelayedexpansion
REM Set Java path
set "JAVA_HOME=C:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot"
set "JAVA_EXE=%JAVA_HOME%\bin\java.exe"
REM Set Maven path - ajuste este caminho para o seu ambiente
set "MAVEN_HOME=C:\Program Files\apache-maven-3.9.6"
set "PATH=%MAVEN_HOME%\bin;%PATH%"
REM Set application directory
set "APP_DIR=%~dp0"
cd "%APP_DIR%"
REM Check if jar exists, if not build it
if not exist "target\dropi-interactor-1.0-SNAPSHOT.jar" (
echo Building application...
call "%MAVEN_HOME%\bin\mvn" clean package -DskipTests
if !ERRORLEVEL! neq 0 (
echo Failed to build application
pause
exit /b 1
)
)
REM Create logs directory if it doesn't exist
if not exist "logs" mkdir logs
REM Run the application
echo Starting application...
"%JAVA_EXE%" -Xmx1G -jar target\dropi-interactor-1.0-SNAPSHOT.jar
REM If there's an error, pause to show the message
if !ERRORLEVEL! neq 0 (
echo Application exited with error code !ERRORLEVEL!
pause
)
endlocal