Maven file transfer failure

When using maven to get dependencies, files are required to download from respository. In some situation, file transfer may be failure.

The following exception will be encountered:

 Description Resource Path Location Type Could not calculate build plan: Failure to transfer xxxxxx:pom:xx.xx.xx from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact xxxxxxx:xxxx:pom:xx.xx.xx from/to central (http://repo1.maven.org/maven2):                                                                                              

 Solution:

Remove all the failed download from your local respository:

Mac or Linux:
find ~/.m2  -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;

Windows:
cd %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i

留言

這個網誌中的熱門文章

Disable ionic's sidemenu content drag to toggle menu

Multiple writable mappings exist for the field. Only one may be defined as writable, all others must be specified read-only.

java.lang.NoClassDefFoundError: org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl$Parser