Reputation: 282
I have this bat script that builds web app and java core. What I want is to build web app then core, but the bat file is closing after building web app. Here's my script
@echo off
echo building webapp.
pause
cd C:\dev\dashboard\dashboard-web
ng build --prod
pause
echo building core.
cd C:\dev\dashboard\dashboard-core
mvn clean package -DskipTests
pause
It close after build web app
Upvotes: 2
Views: 693
Reputation: 30248
From the Maven on Windows article: You run Maven by invoking a command-line tool: mvn.cmd
…
Use
CALL mvn clean package -DskipTests
CALL a second batch file
The
CALL
command will launch a new batch file context along with any specified parameters. When the end of the second batch file is reached (or if EXIT is used), control will return to just after the initialCALL
statement.
Upvotes: 2
Reputation: 13515
Use the call
command to return execution to the parent script.
@echo off
echo building webapp.
pause
cd C:\dev\dashboard\dashboard-web
call ng build --prod
pause
Docs: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/call
Upvotes: 4