Maven error "Failure to transfer..."

Thanks for the replies, but after some more searching I was able to fix the problem. It turned out that I had to remove one of the "*.lastUpdated" which was preventing one of my plugins (Maven Surefire Plugin) from updating. I did this manually, because a maven clean wasn't doing it apparently.

The problem was that the "*.lastUpdated" file for a plugin was blocking the maven check for updates and not allowing a necessary jar to get downloaded.


In Eclipse: Right click the project->Maven->Update Project->Check checkbox "Force Update of Snapshots/Releases". Click OK.


This worked for me in Windows as well.

  1. Locate the {user}/.m2/repository (Using Juno /Win7 here)
  2. In the Search field in upper right of window, type ".lastupdated". Windows will look through all subfolders for these files in the directory. (I did not look through cache.)
  3. Remove them by Right-click > Delete (I kept all of the lastupdated.properties).
  4. Then go back into Eclipse, Right-click on the project and select Maven > Update Project. I selected to "Force Update of Snapshots/Releases". Click Ok and the dependencies finally resolved correctly.

Remove all your failed downloads:

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

For windows:

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

Then rightclick on your project in eclipse and choose Maven->"Update Project ...", make sure "Update Dependencies" is checked in the resulting dialog and click OK.

Tags:

Eclipse

Maven