V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Curiosity777
V2EX  ›  Java

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

  •  
  •   Curiosity777 · Apr 22, 2024 · 4086 views
    This topic created in 746 days ago, the information mentioned may be changed or developed.
    8 replies    2024-05-06 16:54:58 +08:00
    dncba
        1
    dncba  
       Apr 22, 2024
    本地仓库直接删目录
    WUWENZE
        2
    WUWENZE  
       Apr 22, 2024
    find ~/.m2/repository -type f -name "*.lastUpdated" -exec rm -vrf {} \;
    flyup
        3
    flyup  
       Apr 22, 2024
    everything 打开,直接搜索.lastUpdated
    Curiosity777
        4
    Curiosity777  
    OP
       Apr 22, 2024
    @WUWENZE windows 环境
    Curiosity777
        5
    Curiosity777  
    OP
       Apr 22, 2024
    @flyup 这个可以
    cherishd
        6
    cherishd  
       Apr 22, 2024   ❤️ 2
    repository 目录下 cmd ,不要用 powershell

    for /r %i in (*.lastUpdated) do del %i
    Curiosity777
        7
    Curiosity777  
    OP
       Apr 23, 2024
    @hellwen 👍
    standstill
        8
    standstill  
       May 6, 2024
    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 脚本
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5173 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 64ms · UTC 09:50 · PVG 17:50 · LAX 02:50 · JFK 05:50
    ♥ Do have faith in what you're doing.