Skip to content

Instantly share code, notes, and snippets.

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

  • Save nickname55/5fb3ccbad2313da6ff9b15288f6ebfd3 to your computer and use it in GitHub Desktop.

Select an option

Save nickname55/5fb3ccbad2313da6ff9b15288f6ebfd3 to your computer and use it in GitHub Desktop.
Maven Mirror Configuration Issue with Atlassian Plugin SDK

Maven Mirror Configuration Issue with Atlassian Plugin SDK

Problem

When building an Atlassian Jira plugin, Maven fails with the following error:

Artifact com.atlassian.pom:public-pom:pom:5.0.21 is present in the local repository,
but cached from a remote repository ID that is unavailable in current build context,
verifying that is downloadable from [maven-central (https://repo.maven.apache.org/maven2, default, releases+snapshots)]

Failed to read artifact descriptor for com.atlassian.maven.plugins:jira-maven-plugin:jar:8.1.2
Unknown packaging: atlassian-plugin

Root Cause

The settings.xml file contains a mirror configuration that redirects all repository requests to Maven Central:

<mirror>
    <id>maven-central</id>
    <url>https://repo.maven.apache.org/maven2</url>
    <mirrorOf>*,!atlassian-local,!atlassian-public</mirrorOf>
</mirror>

Key misconception: The mirrorOf parameter matches repository IDs, not artifact groupIds. So !atlassian-public excludes a repository with ID atlassian-public, not all com.atlassian.* artifacts.

The problem is that the profile defines repositories with different IDs:

  • atlassian-snapshots
  • maven-atlassian-all-public
  • maven-atlassian-all-closedsource
  • atlassian-proxy

These IDs are not excluded from the mirror, so Maven redirects requests for Atlassian artifacts to Maven Central, where they don't exist.

Solution

Edit settings.xml and add all Atlassian repository IDs to the exclusion list:

<!-- Before -->
<mirrorOf>*,!atlassian-local,!atlassian-public</mirrorOf>

<!-- After -->
<mirrorOf>*,!atlassian-local,!atlassian-public,!atlassian-snapshots,!maven-atlassian-all-public,!maven-atlassian-all-closedsource,!atlassian-proxy</mirrorOf>

How to Find Repository IDs

Check the _remote.repositories file in your local Maven repository:

cat ~/.m2/repository/com/atlassian/pom/public-pom/5.0.21/_remote.repositories

Output shows which repository IDs the artifact was downloaded from:

public-pom-5.0.21.pom>atlassian-proxy=
public-pom-5.0.21.pom>maven-atlassian-all-public=

These IDs must be excluded from the mirror.

Verification

After fixing settings.xml, rebuild:

atlas-mvn clean package

Additional Tips

  • Always backup settings.xml before making changes
  • Use -X flag for debug output: atlas-mvn package -X
  • Use -U flag to force update cached artifacts: atlas-mvn package -U
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment