第一种:windows下bat命令
@echo off
rem 这里写你的仓库路径
set REPOSITORY_PATH=F:\study\apache-maven-3.0.3\repository
rem 正在搜索...
for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do (
del /s /q %%i
)
rem 搜索完毕
pause
# 这里写你的仓库路径
REPOSITORY_PATH=~/Documents/tools/apache-maven-3.0.3/repository
echo 正在搜索...
find $REPOSITORY_PATH -name "*lastUpdated*" | xargs rm -fr
echo 搜索完
第二种:
windows系统
cd %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i
自定义repository
linux系统
find {{repository}} -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;
没指定仓库则直接输入:
find /root/.m2/repository -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;