You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Robert Scholte (JIRA)" <ji...@apache.org> on 2019/04/17 17:03:00 UTC

[jira] [Closed] (MNG-6645) Maven caches missing release dependencies, so further builds fail without checking the repo until the cache expires or -U is included to flush the cache

     [ https://issues.apache.org/jira/browse/MNG-6645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte closed MNG-6645.
-------------------------------
    Resolution: Not A Problem
      Assignee: Robert Scholte

Thank you for the suggestion. It is a shame you've waited that long and are suffering for several years, because the solution to your problem is already available for a long time.

The first thing you can do is improve the settings.xml by [reconfiguring the repositories|https://maven.apache.org/settings.html#Repositories]. As you can see, the default is daily, but it can be changed to always.

The other solution we see quite often is adding {{-U}} to the commandline options, which will force an update of unknown releases and all snapshots.

Maven is about convention over configuration and in general the current settings are good enough. However, if you prefer other values than the defaults, you have the option to override them.

> Maven caches missing release dependencies, so further builds fail without checking the repo until the cache expires or -U is included to flush the cache
> --------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MNG-6645
>                 URL: https://issues.apache.org/jira/browse/MNG-6645
>             Project: Maven
>          Issue Type: Wish
>            Reporter: Réda Housni Alaoui
>            Assignee: Robert Scholte
>            Priority: Major
>
> I have been experiencing this behaviour for many years.
> Today, I decided to open an issue about it.
> When Maven fails to resolve a release dependency, it caches the fact that it did not find it with this kind of message:
> {code:java}
> 16:42:13 [ERROR] Plugin com.cosium.code:maven-git-code-format:1.23 or one of its dependencies could not be resolved: Failure to find com.cosium.code:maven-git-code-format:jar:1.23 in https://repo.cosium.com/repository/all was cached in the local repository, resolution will not be reattempted until the update interval of cosium-repo-all has elapsed or updates are forced -> [Help 1]{code}
> In my example, I cut a new artifact release to Maven Central. Once the release is done, you must wait a few minutes or hours before being able to pull the artifact from Maven Central. I forgot and didn't wait enough time.
> Because of this mistake, our CI machine cached the "failure". The only way to make the CI build work again is to ssh the CI machine and remove the incorrect part from the local maven repository.
> I think that Maven should never cache the resolution failure, it should retry the resolution on each build.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)