maven清理本地仓库。删除_remote.repositories文件和删除失败的jar包

1.图预览

.bat文件要和仓库在同一平级目录

REPOSITORY_PATH要改成你自己仓库的地址

2、删除.lastUpdated文件(失败的jar包)

使用.bat文件

注明:REPOSITORY_PATH=D:\software\Java\maven\repository 改成你仓库的地址

set REPOSITORY_PATH=D:\software\Java\maven\repository

for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do (

del /s /q %%i

)

pause

3、删除_remote.repositories文件

注明:REPOSITORY_PATH=D:\software\Java\maven\repository 改成你的仓库地址

set REPOSITORY_PATH=D:\software\Java\maven\repository

rem 正在搜索...

for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*_remote.repositories*"') do (

del /s /q %%i

)

rem 搜索完毕

pause

说明:如果你私服里面没有jar包。本地仓库有_remote.repositories文件,idea无法加载你本地jar包会出现。maven依赖爆红。找不到本地jar包

4、删除_maven.repositories文件(没影响可留)

set REPOSITORY_PATH=D:\software\Java\maven\repository

rem 正在搜索...

for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*_maven.repositories*"') do (

del /s /q %%i

)

rem 搜索完毕

pause

5、效果图(实测安全有效)

相关推荐
用户8356290780515 小时前
Python 实现 PowerPoint 形状动画设置
后端·python
ponponon6 小时前
时代的眼泪,nameko 和 eventlet 停止维护后的项目自救,升级和替代之路
python
Flittly6 小时前
【从零手写 ClaudeCode:learn-claude-code 项目实战笔记】(5)Skills (技能加载)
python·agent
敏编程6 小时前
一天一个Python库:pyarrow - 大规模数据处理的利器
python
Flittly8 小时前
【从零手写 ClaudeCode:learn-claude-code 项目实战笔记】(4)Subagents (子智能体)
python·agent
明月_清风14 小时前
Python 装饰器前传:如果不懂“闭包”,你只是在复刻代码
后端·python
明月_清风15 小时前
打破“死亡环联”:深挖 Python 分代回收与垃圾回收(GC)机制
后端·python
ZhengEnCi1 天前
08c. 检索算法与策略-混合检索
后端·python·算法
明月_清风2 天前
Python 内存手术刀:sys.getrefcount 与引用计数的生死时速
后端·python
明月_清风2 天前
Python 消失的内存:为什么 list=[] 是新手最容易踩的“毒苹果”?
后端·python