@echo off
echo @Author Fate
echo @Date Mon Jan 24 2020 10:00:56 GMT+0800
:again
set /p REPOSITORY_PATH=Please enter the local your maven warehouse path:
:: Remove all double quotes
set REPOSITORY_PATH=%REPOSITORY_PATH:"=%
if not exist "%REPOSITORY_PATH%" (
echo Maven warehouse address not found, please try again.
goto again
)
for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do (
del /s /q "%%i"
)
echo Expired files deleted successfully.
pause;
- 使用方法:
复制上面内容,保存为xxx.bat文件,双击打开,输入maven仓库的地址或者把仓库的文件夹拖入到命令窗口,在回车即可。