Skip to content

Instantly share code, notes, and snippets.

@GlinZachariah
Last active October 15, 2021 17:20
Show Gist options
  • Save GlinZachariah/cd25e9590b55513f6f4591583df44171 to your computer and use it in GitHub Desktop.
Save GlinZachariah/cd25e9590b55513f6f4591583df44171 to your computer and use it in GitHub Desktop.
Update Maven projects automatically
@ECHO OFF
ECHO RUNNING AUTOUPDATER..
TIMEOUT 2 >NUL
::saving the current working directory
set cwd=%cd%
::specify a build.txt file with path of each dependencies and projects to be built in order
for /f "tokens=*" %%s in (build.txt) do(
cd %%s
call :auto_update %%s
cd %cwd%
)
:: Check the logs for any errors before application termination
pause
GOTO :eof
:auto_update
ECHO FETCHING FOR %1
START /wait "Running install.." CMD /c git switch master && git pull && mvn clean install -DskipTests
ECHO COMPLETED MVN INSTALLATION
EXIT /B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment