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
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:
- The update interval elapses (default: 24 hours for releases, configurable per-repository)
- Updates are explicitly forced with
-Uflag
This is a performance optimization, but it can be frustrating when you're troubleshooting dependency issues.
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 -URemove 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" -deleterm -rf ~/.m2/repository/org/jenkins-ci/jenkins/1.39In 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=1706348400000Configure proper repositories before the first build attempt. If Maven caches a failure from the wrong repository, you'll need to clear the cache.
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.