ARTIFACTORY: How to Resolve the Common Maven Error: resolution will not be reattempted

Joey Naor
2023-01-22 11:10

When building a new project, you might encounter a very common Maven error:[ERROR] Failed to execute goal on project : Could not resolve dependencies for project . The following artifacts could not be resolved: : Failure to find in https://artifactory:8081/artifactory/ was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
This is caused by Maven’s defaultupdatePolicy. Simply put, Mavenfetches artifactsfrom your Artifactory repositories on adailybasis. However, if there were anyinterruptions, Maven willnotmake a fetch reattempt for another 24 hours.

Tobypassthis default restriction, you can:

  • 添加-Uflag to themaven installcommand, or
  • configure your Maven clients’settings.xmlfile with the following value:always

Published: Sept. 29, 2020
Last updated: Jan. 25, 2021

Keywords: Maven, update policy