문제

I'm trying to get the errorlevel after calling Maven from my batch file. Simplified example:

call mvn clean test
if errorlevel 0 echo Build success

The problem is, the error level will always be 0 even if the build fails. How can I access the errorlevel set by the called process?

도움이 되었습니까?

해결책

A third method:

if not errorlevel 1 echo no error

This is because errorlevel 0 is always true

다른 팁

try this:

call mvn clean test
if %errorlevel% equ 0 echo Build success

For windows 7, I find that 'if %errorlevel%==0 echo Build success' or what ever you want for output.

Hope this helps.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top