1. Picture preview
The .bat file must be in the same level directory as the warehouse
. REPOSITORY_PATH must be changed to the address of your own warehouse
. 2. Delete the .lastUpdated file (failed jar package)
and use the .bat file.
Note: REPOSITORY_PATH=D:\software\Java\maven\repository change to the address of your warehouse
set REPOSITORY_PATH=D:\software\Java\maven\repository
for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do (
del /s /q %%i
)
pause
3. Delete the _remote.repositories file.
Note: REPOSITORY_PATH=D:\software\Java\maven\repository and change it to your warehouse address.
set REPOSITORY_PATH=D:\software\Java\maven\repository
rem Searching...
for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*_remote.repositories*"') do (
del /s /q %%i
)
rem search completed
pause
Note: If there is no jar package in your private server. The local warehouse has the _remote.repositories file, and it will appear that idea cannot load your local jar package. maven relies on popularity. Cannot find local jar package
4. Delete the _maven.repositories file (leave it if it has no impact)
set REPOSITORY_PATH=D:\software\Java\maven\repository
rem Searching...
for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*_maven.repositories*"') do (
del /s /q %%i
)
rem search is completed
pause
5. Effect diagram (safe and effective according to actual measurement)