Skip to content

Instantly share code, notes, and snippets.

@nickname55
Created January 27, 2026 07:54
Show Gist options
  • Select an option

  • Save nickname55/4e1609b9f8bc089a76518fc30109f8f5 to your computer and use it in GitHub Desktop.

Select an option

Save nickname55/4e1609b9f8bc089a76518fc30109f8f5 to your computer and use it in GitHub Desktop.
Maven Cached Resolution Failure - How to Fix

Maven Cached Resolution Failure

Problem

Maven build fails with an error like:

org.jenkins-ci:jenkins:pom:1.39 was not found in https://packages.atlassian.com/maven-public/
during a previous attempt. This failure was cached in the local repository and resolution
is not reattempted until the update interval of maven-atlassian-all-public has elapsed
or updates are forced

Root Cause

Maven caches both successful and failed artifact resolution attempts. When Maven fails to find an artifact in a repository, it records this failure and won't retry until:

  1. The update interval elapses (default: 24 hours for releases, configurable per-repository)
  2. Updates are explicitly forced with -U flag

This is a performance optimization, but it can be frustrating when you're troubleshooting dependency issues.

Solution

Quick Fix: Force Update

Use the -U flag to force Maven to re-check all remote repositories:

mvn clean package -U
# or with Atlassian SDK
atlas-mvn clean package -U

Alternative: Delete Cached Failure Markers

Remove the .lastUpdated files from your local repository:

# Find and delete all .lastUpdated files for a specific artifact
find ~/.m2/repository/org/jenkins-ci -name "*.lastUpdated" -delete

# Or for all artifacts (use with caution)
find ~/.m2/repository -name "*.lastUpdated" -delete

Alternative: Delete the Entire Artifact Directory

rm -rf ~/.m2/repository/org/jenkins-ci/jenkins/1.39

Understanding the Cache Files

In your local repository, you might see files like:

~/.m2/repository/org/jenkins-ci/jenkins/1.39/
├── jenkins-1.39.pom.lastUpdated
└── _remote.repositories

The .lastUpdated file contains timestamps of failed attempts:

#NOTE: This is a Maven Resolver internal implementation file
https\://packages.atlassian.com/maven-public/.error=
https\://packages.atlassian.com/maven-public/.lastUpdated=1706348400000

Prevention

Configure proper repositories before the first build attempt. If Maven caches a failure from the wrong repository, you'll need to clear the cache.

Repository Update Policies

You can configure update policies in your pom.xml or settings.xml:

<repository>
    <id>jenkins-releases</id>
    <url>https://repo.jenkins-ci.org/releases/</url>
    <releases>
        <updatePolicy>always</updatePolicy>  <!-- always, daily, interval:X, never -->
    </releases>
</repository>

Note: always will slow down builds as Maven checks for updates on every build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment