Replies: 5 comments
-
|
Hey! I recently ran into the same issue while building a custom tool to manage Maven artifacts. I had no trouble uploading JARs and even the initial After a bunch of digging (and Wireshark-ing some Gradle traffic for good measure), here’s what I found: 🚫 GitHub Packages Maven Registry is ImmutableThe Maven registry in GitHub Packages does not allow overwriting existing files, including
This is by design — GitHub enforces immutable package versions to ensure consistency and reproducibility. ✅ What Tools Like Maven/Gradle Actually DoYou might see tools like Gradle doing
So even if a 🛠️ Solution / What You Should Do✅ Recommended (Safe) Approach:
💡 If You Need Full Control:If you’re building a custom tool and need more flexibility (like metadata updates or artifact deletion), consider using a full Maven-compatible repository manager like:
These give you full control over:
💬 TL;DRGitHub Packages for Maven is version-immutable — once you upload If you need to update metadata or overwrite files, use a proper Maven repository manager like Nexus or Artifactory. Hope that clears it up! 🔧💡 Let me know if you want a |
Beta Was this translation helpful? Give feedback.
-
|
Hi — great question, and I appreciate the detailed explanation of what you’ve tried so far. GitHub Packages' Maven registry does have a couple of limitations and behaviors that differ from a typical Maven repository manager like Nexus or Artifactory: 📌 Key points to note: This is why your PUT request to update maven-metadata.xml returns a 409 Conflict — because a file with the same path already exists and the registry doesn’t allow overwriting it. The DELETE method isn’t supported on individual files either — hence your 405 Method Not Allowed response. GitHub only allows deleting an entire package version via their REST API for Packages, not individual files within a package. 📌 How does Gradle or Maven manage this? Upload the maven-metadata.xml only if it doesn't already exist, or Work with a repository that allows metadata merging on the server side (like Nexus/Artifactory do — which GitHub Packages currently doesn't support). On GitHub Packages, this limitation makes it hard to implement snapshot-like behavior where metadata is frequently updated. 📌 Possible Workarounds: Structure your build tool to avoid updating existing maven-metadata.xml on GitHub Packages. If necessary, delete the entire package version via the GitHub Packages REST API and re-upload. 📌 Suggestion: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
I am currently working on an custom build tool which also manages maven dependencies and repositories.
I recently got it working with some local maven repository servers to test it on (uploading and downloading artifacts).
But I have problems getting it working with GitHub Packages, uploading my artifacts works fine, but if I try to update the maven-metadata.xml using an HTTPS PUT request, I get the HTTP status code 409 Conflict.
My first guess was that this is because the file already exists, so I tried to send an HTTP DELETE request first, but this request was responded to with 405 Method not allowed.
Are there some special conditions that I must met before I can update an file ?
The initial upload of the first maven-metadata.xml works fine, like all the other artifacts, just updating it seems to give me errors.
Out of curiosity, I tried to spy on gradle during an upload using Wireshark, and from what I can tell it does the same as I do.
It first downloads the current metadata using GET, then uploads the new one using PUT.
I have no Idea why my requests get denied, and why only the ones for updating an existing file.
Beta Was this translation helpful? Give feedback.
All reactions