r/java • u/danielliuuu • Dec 15 '25
I got so frustrated with Maven Central deployment that I wrote a Gradle plugin
Background
Before Maven Central announced OSSRH Sunset, my publishing workflow was smooth. Life was good. Then the announcement came. No big deal, right? Just follow the migration guide. Except... they didn't provide an official Gradle plugin.
The docs recommended using jreleaser (great project), so I started migrating. What followed was 3 days of debugging and configuration hell that nearly killed my passion for programming. But I persevered, got everything working, and thought I was done.
Everything worked fine until I enabled Gradle's configuration cache. Turns out jreleaser doesn't play nice with it. Okay, fine - I can live without configuration cache. Disabled it and moved on. Then I upgraded spotless. Suddenly, dependency conflicts because jreleaser was pulling in older versions of some libraries. That was my breaking point. I decided to write a deployment plugin - just a focused tool that solves this specific problem in the simplest way possible.
Usage
plugins {
id "io.github.danielliu1123.deployer" version "+"
}
deploy {
dirs = subprojects.collect { e -> e.layout.buildDirectory.dir("repo").get().getAsFile() }
username = System.getenv("MAVENCENTRAL_USERNAME")
password = System.getenv("MAVENCENTRAL_PASSWORD")
publishingType = PublishingType.AUTOMATIC
}
I know I'm not the only one who struggled with the deployment process. If you're frustrated with the current tooling, give this a try. It's probably the most straightforward solution you'll find for deploying to Maven Central with Gradle.
GitHub: https://github.com/DanielLiu1123/maven-deployer
Feedback welcome!
18
u/NegativeAlps Dec 15 '25
The Gradle docs seem to recommend the community plugin com.vanniktech.maven.publish. It is also mentioned as an alternative on the Maven Central docs. Did you try that one before deciding to create your own plugin?
14
u/SleeperAwakened Dec 15 '25
That actually looks nice and elegant project, thanks!
I heard complaints about the maven central release flow before, but what I can get from your plugin is that it is not that complicated.
Now that you ran into the issues before, and solved them yourself - can you explain what the actual problem with the existing tooling really is?
5
u/rahulsom Dec 16 '25
I ended up writing a plugin that wraps around Nebula Release and JReleaser. And I'm not alone in that. This almost feels like a rite of passage.
It would be awesome if Gradle makes MavenCentral publishing a high-level goal. They seem to be more focussed on solving enterprise problems than OSS problems. There was some talk around having this be a GSoC project. I'm not sure whether it's making it into Gradle proper.
4
u/shannah78 Dec 15 '25
Nice . i tried publishing a gradle project the other day and ended up deciding it wasn't worth it after an hour of banging my head. Next time i'll try this
5
u/woj-tek Dec 15 '25
Erm… just to clarify - your issue is with GRADLE and not maven - right? because your title reads like: "maven is so terrible that I had to migrate to gradle to work with it" xD
1
u/godorHOTS Dec 18 '25
Same same, I can recommend jitpack.io. Nice and easy, if you some is still looking for alternatives
1
u/NovaX Dec 16 '25
Any reason you decided not to use the legacy bridge? I use the gradle-nexus/publish-plugin, updated the urls, and it works perfectly. I was not eager to rewrite and was hoping the community would fill the gap so thank you.
-1
u/FollowsClose Dec 15 '25
I will give this a try tonight!