Download the wrong files quickly clean up maven repository

Sometimes the use of pom file to download dependent files when suddenly network anomalies may occur dependent files appear damaged, causing how can not be used, nor re-download.

Before solution is to find and delete the file appears damaged, allowed to re-download, but is inefficient, it is difficult to find which file is damaged, angry about the whole maven local repository are deleted, so it is not worth the candle.

In fact, as long as you can put some dos command to delete the warehouse of all damaged files, fast and easy to use.

OFF @echo
 SET repository_path = D: \ Tools \ path \ the repo \ 
REM start deleting ... 
for / F " delims = " %% I in ( ' the dir / B / S "repository_path%% \ * * lastUpdated" ' ) do ( 
    del / S / Q %% I 
) 
REM deletion completion !! 
PAUSE
= repository_path the SET D: \ Tools \ path \ repo \
to this path into your repository path, and then run as administrator. (Important!)
Suggested that this command is set to bat file for later use.

 

This command to the network, relatively long time to forget the original address. . . .

Guess you like

Origin www.cnblogs.com/hunmeng/p/11263162.html