I have some spring projects in my workspace. And I use GitHub to manage all the source code of different spring projects. When I import those spring projects to a newly set up machine in eclipse, I find an error message like Failure to transfer antlr:antlr:jar:2.7.7 from https://repo.maven.apache.org/maven2 was cached in the local repository. After some time of investigation, I finally find the method to fix this error. This article will tell you how to resolve it.
Failure to transfer antlr:antlr:jar:2.7.7 from https://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 antlr:antlr:jar:2.7.7 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org org.eclipse.aether.transfer.ArtifactTransferException: Failure to transfer antlr:antlr:jar:2.7.7 from https://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 antlr:antlr:jar:2.7.7 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:240) at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:208) at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:563)
You can follow the below steps to fix this problem.
- Open a terminal and go to the spring project folder.
- Then execute the below maven command to force update the local maven repository.
$ mvn eclipse:eclipse
- You can see that the above command will download several jars from the maven repository again and build the project until success. Open eclipse and import the spring project again then the error is fixed.
it worked for me!