I have the following bat script:
@echo off
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_32
set JRE_HOME=C:\Program Files\Java\jdk1.6.0_32\jre
set Path=%JAVA_HOME%\bin;%Path%
cd C:\project
mvn validate compile package db-migration:migrate -DskipTests
REM script exits here, the second line never been executed
java -jar target/compiled_tar.jar
The last line never been executed. The “mvn…” is successfully done, the compiled_tar.jar is created, the output is:
[INFO] BUILD SUCCESS
If I insert the PAUSE command between last and previous lines the PAUSE also never been occurred. Why?
mvnis itself a.batfile, so (for compatibility with MS-DOS 1.0) Windows will stop executing your batch file. To fix this, use thecallcommand: