Clean up dependent packages that failed to download in the maven warehouse

Brief description

  When we introduce the maven dependency package in the idea, the download of the dependency package will fail due to bad network conditions, computer freezes, etc.; and after the download fails, reloading does not solve the problem, but needs to be cleaned up first Reload can be performed only after downloading failed files.

Solution

set REPOSITORY_PATH=你的maven仓库全路径(如d:maven)
rem 正在搜索...
for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do (
    del /s /q %%i
)
rem 搜索完毕
pause
  1. Copy and paste the above code into your notepad, and modify the suffix to .bat

  2. Modify the path path, modify the path path to the full path of your maven warehouse storage disk

  3. Double-click to run, you can delete the jar package that failed to download

  4. After running, just close it

  5. Open idea and reload again, this time it can usually be successful

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41071754/article/details/110110576