一键删除maven仓库无效jar包脚本

  • 一键删除maven仓库无效jar包脚本
@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仓库的地址或者把仓库的文件夹拖入到命令窗口,在回车即可。
posted @ 2020-07-24 10:18  Fate_p  阅读(1112)  评论(0编辑  收藏  举报