apache / apache/maven-resolver

[MRESOLVER-555] Existence check should lax the repository update policy

Open
#1,224 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
152
Forks
160
Avg merge
1d 4h
Merged PRs (30d)
49

Description

**[Tamas Cservenak](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=cstamas)** opened **[MRESOLVER-555](https://issues.apache.org/jira/browse/MRESOLVER-555?redirect=false)** and commented

Maybe only when update policy is "never".

Order of events:
* attempt a build with not-yet-released-artifact (for example resolver in maven)
* as it is not in central, build will fail, and central URL will be "cached" as 404 for given artifact
* fix, rinse, repeat, add staging repository, rebuild
* build will pass ok, as staging repository will have the artifact, it is cached to local repository (from staging repository)
* later, staging repository is dropped, release promoted to central.
* rebuild: here, Resolver will nag that "artifact is present but not available", which is true: it was cached from staging repository
* it will go try to see is it available in central (existence check), but: central has 404 cached (see step 1), and in this case update policy is being obeyed, that is "never"
* due "never" update policy existence check will fail, and build will fail

Now, IMO, for "existence check" Resolver should lax the policy ONLY if it is "never" maybe? As from this situation only escape route is build with -U that will reset local repository state and build will pass.

---

**Issue Links:**
- [MNG-8076](https://issues.apache.org/jira/browse/MNG-8076) when jar in local repository from other repository id, should not reject but check if it is also available in current repository id context

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the described sequence with a cached 404, a staging repository, and update policy "never"; then trace the resolver's existence-check and repository update-policy handling. Done means the existence check can correctly detect the artifact after it moves from staging to the promoted repository without requiring -U, while preserving normal update-policy behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.