Nexus cleanup policy deleted an artifact your CI needs in CI
Nexus cleanup policies delete components by age, last-downloaded, or release type. If a policy is too aggressive it removes a snapshot or release a pipeline still resolves, and the build fails with a not-found even though nothing in your code changed.
What this error means
A previously green build suddenly cannot resolve a dependency ("was not found") that a scheduled cleanup task removed from the hosted repo.
[ERROR] Could not resolve dependencies for project app:
Could not find artifact com.example:lib:jar:1.4.0-20260610.101112-3 in nexus
(https://nexus.example.com/repository/maven-snapshots/)Common causes
An overly aggressive age/last-downloaded policy
A cleanup policy deleting components older than N days, or not downloaded recently, removed an artifact a build still pins.
Snapshot retention lower than build cadence
Keeping too few snapshots per version deletes ones referenced by long-running or infrequent pipelines.
How to fix it
Loosen the cleanup policy or pin releases
- Review the repository cleanup policy in Nexus (age, last downloaded, release type).
- Raise retention or exclude releases that builds depend on.
- Rebuild and publish the missing artifact if it must exist again.
# In Nexus: Repository, Cleanup Policies
# - increase "Component Age" / "Components not downloaded in" thresholds
# - scope the policy to snapshots only, not releasesDepend on immutable releases, not fleeting snapshots
Pin builds to release versions that cleanup policies exclude, so scheduled deletion cannot pull the rug out.
How to prevent it
- Scope cleanup policies to snapshots, keeping releases.
- Set retention above your slowest pipeline cadence.
- Prefer pinned releases over ephemeral snapshots in critical builds.