Hi fellow Maven users,

I have used Maven for 10 years or more and I’m writing with a first. I have a 
project which was set up in Jenkins with a settings.xml that has updatePolicy 
set to “never” for a certain repository.

I have experienced that when Maven 3.3.9 fails to resolve an artifact for any 
reason (could be connection error, the artifact is not there at the time, or 
any other reason) the first build notes that it will “cache the failure” as 
follows:


Failure to find org.example:foo:jar:0.0.1-RELEASE in 
https://example.org/foo/repository/ was cached in the local repository, 
resolution will not be reattempted until the update interval of foo.repository 
has elapsed or updates are forced



Subsequent builds then always fail with log output similar to the below, 
regardless of whether the connection can be re-established or the dependency is 
now available:


14:01:07 [ERROR] Failed to execute goal on project foo: Could not resolve 
dependencies for project org.example:foo:jar:0.0.1-RELEASE: Failed to collect 
dependencies for org.example:foo:jar:0.0.1-RELEASE: Failed to read artifact 
descriptor for org.example:foo:jar:0.0.1-RELEASE: Could not find artifact 
org.example:foo:jar:0.0.1-RELEASE in foo.repository 
(https://example.org/foo/repository/) ….


Unfortunately, I believe the -U flag cannot be used here as it applies to 
SNAPSHOT dependencies only. An experiment of passing -U further bore this out 
and did not resolve the issue.

My questions here are:


  1.  Is this the expected behavior for “never” value of updatePolicy?
  2.  If so, what purpose is this “never” setting meant to serve? What is a 
valid use case?
  3.  Is there any way to force the update for a RELEASE artifact when 
updatePolicy is “never”?

Scott


Reply via email to