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

Joey Naor
2021-01-28 18:34

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

When building a new project, you might encounter a very common Maven error:[ERROR] Failed to execute goal on project <project-name>: Could not resolve dependencies for project <project-name>. The following artifacts could not be resolved: <artifact>: Failure to find <artifact> in https://artifactory:8081/artifactory/<repo-name> 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 default updatePolicy. Simply put, Maven fetches artifacts from your Artifactory repositories on a daily basis. However, if there were any interruptions, Maven will not make a fetch reattempt for another 24 hours. 

To bypass this default restriction, you can:

  • add the -U flag to the maven install command, or
  • configure your Maven clients’ settings.xml file with the following value: <updatePolicy>always</updatePolicy>

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

Keywords: Maven, update policy