V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Curiosity777
V2EX  ›  Java

有什么优雅的方式清理 Maven 仓库下载失败包吗

  •  
  •   Curiosity777 · 19 天前 · 1274 次点击
    8 条回复    2024-05-06 16:54:58 +08:00
    dncba
        1
    dncba  
       19 天前
    本地仓库直接删目录
    WUWENZE
        2
    WUWENZE  
       19 天前
    find ~/.m2/repository -type f -name "*.lastUpdated" -exec rm -vrf {} \;
    flyup
        3
    flyup  
       19 天前
    everything 打开,直接搜索.lastUpdated
    Curiosity777
        4
    Curiosity777  
    OP
       19 天前
    @WUWENZE windows 环境
    Curiosity777
        5
    Curiosity777  
    OP
       19 天前
    @flyup 这个可以
    hellwen
        6
    hellwen  
       19 天前   ❤️ 2
    repository 目录下 cmd ,不要用 powershell

    for /r %i in (*.lastUpdated) do del %i
    Curiosity777
        7
    Curiosity777  
    OP
       18 天前
    @hellwen 👍
    standstill
        8
    standstill  
       5 天前
    set REPOSITORY_PATH=D:\your\maven\repository
    for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do (
    del /s /q %%i
    )
    rem 搜索完毕
    pause


    bat 脚本
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3012 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 14:02 · PVG 22:02 · LAX 07:02 · JFK 10:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.