maven下载jar包时lastUpdated问题

在搭建项目时,发现引用的jar包都找不到,到本次仓库查看发现所有的文件后缀都为.lastUpdated 这是下载出错了。
因为以前都是用的阿里云的仓库,认为镜像不会出错。后来找了很久,最后在
pom.xml文件路径下执行 mvn compile -U命令,发现果然是镜像问题,附上亲测有效镜像:

<mirrors>
	<mirror>
		<id>alimaven</id>
		<name>aliyun maven</name>
		<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
		<mirrorOf>central</mirrorOf>
	</mirror>
</mirrors>

及清楚所有lastUpdated文件bat文件:

@echo off
rem create by NettQun
  
rem 这里写你的仓库路径
set REPOSITORY_PATH=本地仓库路径
rem 正在搜索...
for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do (
    echo %%i
    del /s /q "%%i"
)
rem 搜索完毕
pause

猜你喜欢

转载自blog.csdn.net/Demo_gui/article/details/88931359