Migrate to com.vanniktech.maven.publish plugin for Maven Central Portal#752
Conversation
Co-authored-by: huayanYu <16700837+huayanYu@users.noreply.github.com>
Co-authored-by: huayanYu <16700837+huayanYu@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR modernizes the Maven publishing configuration by migrating from manual maven-publish and signing plugin configuration to the com.vanniktech.maven.publish plugin v0.32.0, targeting the new Maven Central Portal infrastructure. This simplifies the build configuration and aligns with modern Maven Central publishing practices.
Key changes:
- Replaced 62 lines of manual publishing/signing setup with automated plugin-based configuration
- Configured Maven Central Portal publishing via SONATYPE_HOST=CENTRAL_PORTAL
- Centralized POM metadata in gradle.properties for consistent artifact publishing
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| build.gradle.kts | Replaced manual maven-publish and signing plugins with com.vanniktech.maven.publish plugin v0.32.0, removing all manual repository and signing configuration |
| gradle.properties | Added Maven Central Portal configuration (SONATYPE_HOST, RELEASE_SIGNING_ENABLED) and POM metadata properties (name, description, license, SCM, developers) required by the plugin |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| POM_DEVELOPER_ID=TaoYu | ||
| POM_DEVELOPER_NAME=TaoYu | ||
| POM_DEVELOPER_URL=https://github.com/baomidou/dynamic-datasource-spring-boot-starter |
There was a problem hiding this comment.
Inconsistent URL format. Line 32 and 38 have trailing slashes while line 44 does not. Consider making the URL format consistent by either adding or removing trailing slashes across all GitHub URLs.
| POM_DEVELOPER_URL=https://github.com/baomidou/dynamic-datasource-spring-boot-starter | |
| POM_DEVELOPER_URL=https://github.com/baomidou/dynamic-datasource-spring-boot-starter/ |
Modernize Maven publishing configuration to support the new Maven Central Portal, following the approach from https://github.com/aizuda/flowlong.
Changes
build.gradle.kts
maven-publishconfiguration withcom.vanniktech.maven.publishplugin v0.32.0gradle.properties
SONATYPE_HOST=CENTRAL_PORTALfor new Maven Central infrastructureRELEASE_SIGNING_ENABLED=truefor artifact signingPublishing behavior
The existing
.github/workflows/release.ymlis already compatible. It usespublishAllPublicationsToMavenCentralRepositorytask and provides GPG secrets via environment variables:ORG_GRADLE_PROJECT_mavenCentralUsernameORG_GRADLE_PROJECT_mavenCentralPasswordORG_GRADLE_PROJECT_signingInMemoryKeyORG_GRADLE_PROJECT_signingInMemoryKeyPasswordLocal builds work without signing credentials. Publishing requires GPG keys (provided in CI).
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
gitlab.xuxiaowei.com.cn/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/gradle-launcher-8.5.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/agents/gradle-instrumentation-agent-8.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon(dns block)maven.aliyun.com/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/gradle-launcher-8.5.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/agents/gradle-instrumentation-agent-8.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.