maven - 一鍵刪除maven倉庫無效jar包工具


背景

在進行maven開發時,往往需要下載大量jar包,而由於網絡不穩定等其他因素可能導致jar未下載完畢,然后保留了lastUpdated文件,導致無法更新失效的jar包。
現在提供個bat腳本,只需要輸入maven本地倉庫地址就可以將失效的lastUpdated信息刪除,maven就能夠重新下載失效的jar。

工具封裝

  1. 只需要將倉庫文件夾拖入bat窗口或者將倉庫文件夾路徑填入bat中,就可以清除失效的lastUpdated信息。
  2. 工具已上傳github : 點我進入
@echo off
echo @describe Find out all lastUpdated, and delete its.
echo @github https://github.com/cjunn/script_tool/
echo @author cjunn
echo @date Mon Jan 13 2020 13:13:56 GMT+0800
:again
set /p REPOSITORY_PATH=Please enter the local Maven warehouse Path:
:: Remove all double quotes
set REPOSITORY_PATH=%REPOSITORY_PATH:"=%
if not exist "%REPOSITORY_PATH%" (
   echo Maven warehouse address not found, please try again.
   goto again
)
for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do (
	del /s /q "%%i"
)
echo Expired files deleted successfully.
pause;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM