清除maven加载失败的jar包记录

 1 @echo  off
 2 set REPOSITORY_PATH=.\repository
 3 echo 正在搜索lastUpdated文件...
 4 for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do (
 5     del /s /q %%i
 6 )
 7 echo 清理完毕
 8 echo 正在搜索空文件夹...
 9 for /f "delims=" %%a in ('dir /ad /b /s "%REPOSITORY_PATH%"^|sort /r') do (
10   rd "%%a">nul 2>nul &&echo 空目录"%%a"成功删除!
11 )
12 echo 清理完毕
13 pause

 

posted @ 2021-08-26 14:50  quec1994  阅读(90)  评论(0)    收藏  举报