One nice little problem that has given us a bit of trouble recently is pom errors where non were expected.

A typical error message would be:

Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from http://repo.maven.apache.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 org.apache.maven.plugins:maven-resources-
plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://
repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-
plugin-2.5.pom

This is cause by failed repository downloads, where Maven thinks they have already downloaded and so Maven cannot build the project.

The solution to this is to remove all your failed downloads:

On a mac open a terminal shell and run the following:

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

On Windows run the following:

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

Leave a comment

Skills421

Welcome to Skills421, our knowledge repository for all things tech in the 21st century

Let’s connect

Search