Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent a bat file exiting early?

I'm running a maven plugin (this is just a new process) as part of a bat file.The plugin command causes the bat file to exit so the subsequent commands do not run. Is there a command or some other way to prevent the bat file quitting too soon ?

Here is the bat file :

ECHO Updating Version
mvn versions:set -DnewVersion=1.2

ECHO this echo does not occur

Perhaps I could use the 'call' command as referenced in How do you stop a Windows Batch file from exiting early? but I would like to run all of the code within one bat file.

like image 403
user701254 Avatar asked Nov 28 '12 17:11

user701254


1 Answers

If mvn is a batch file, then you need to precede it with a call, or else it will terminate on that line.

like image 132
RonaldBarzell Avatar answered Oct 04 '22 19:10

RonaldBarzell