[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aether-users] How to distinguish between a fresh and cached "artifact not found"?
|
Hi Benjamin,
>> is there are way to reliable distinguish between the following two cases
>> upon a repositorySystem.resolve(..):
>>
>> - Performed lookup; artifact not found in the remote repository
>> - Just returned a "not found" cached locally.
>
> What's the use case driving this question?
in Eclipse Code Recommenders, we store the models we use to make
recommendations with for library X in a Maven snapshot repository. This
works great; resolution automatically checks every few hours whether
there is a (new) model for library X and, if so, downloads it.
Now, the use case for the above is error reporting. Currently, we log a
warning message to the Eclipse Error Log whenever model resolution
fails. If it fails because there really was not model for library X,
that warning is warranted. However, when I just attempted to resolve
five minutes ago, got a negative response, cached it
(setNotFoundCachingEnabled), and am now trying to resolve again, I
wouldn't want another warning to show up in the Error Log (at most, this
warrants a debug-level message). Thus, I want to be able to distinguish
between the two cases. (Alternatively, I could check in advance whether
a non-stale cached negative response exists -- if I knew how.)
Hope that explanation makes sense to you.
Andreas
--
Codetrails UG (haftungsbeschränkt)
The knowledge transfer company
Robert-Bosch-Str. 7, 64293 Darmstadt
Mobile: +49-170-811-3791
http://www.codetrails.com/
Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940