Maven清理下载失败文件
cleanLastUpdated.bat(windows版本)
@echo off rem create by niudehua rem 这里写你的仓库路径 set REPOSITORY_PATH=D:\Java\maven-repository\maven-aliyun\repository rem 正在搜索... for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do ( echo %%i del /s /q "%%i" ) rem 搜索完毕 pause
cleanLastUpdated.sh(linux版本)
# create by niudehua # 这里写你的仓库路径 REPOSITORY_PATH=/Users/deng/.m2/repository rm -f lastUpdatedFile.txt # 查询 date "+%Y-%m-%d %H:%M:%S" >> lastUpdatedFile.txt echo "开始搜索"$REPOSITORY_PATH >> lastUpdatedFile.txt find $REPOSITORY_PATH -name "*lastUpdated*" >> lastUpdatedFile.txt # 删除 find $REPOSITORY_PATH -name "*lastUpdated*" |xargs rm -fr date "+%Y-%m-%d %H:%M:%S" >> lastUpdatedFile.txt echo "搜索完毕"$REPOSITORY_PATH >> lastUpdatedFile.txt cat lastUpdatedFile.txt