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

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

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

    for /r %i in (*.lastUpdated) do del %i
    Curiosity777
        7
    Curiosity777  
    OP
       284 days ago
    @hellwen 👍
    standstill
        8
    standstill  
       271 days ago
    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   ·   Blog   ·   API   ·   FAQ   ·   Tools   ·   693 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 20:17 · PVG 04:17 · LAX 12:17 · JFK 15:17
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.