Skip to content

Migrate to com.vanniktech.maven.publish plugin for Maven Central Portal#752

Merged
huayanYu merged 3 commits into
masterfrom
copilot/add-maven-repo-publishing-config
Dec 18, 2025
Merged

Migrate to com.vanniktech.maven.publish plugin for Maven Central Portal#752
huayanYu merged 3 commits into
masterfrom
copilot/add-maven-repo-publishing-config

Conversation

Copilot AI commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Modernize Maven publishing configuration to support the new Maven Central Portal, following the approach from https://github.com/aizuda/flowlong.

Changes

build.gradle.kts

  • Replace manual maven-publish configuration with com.vanniktech.maven.publish plugin v0.32.0
  • Remove 62 lines of manual publishing/signing setup—plugin handles this automatically

gradle.properties

  • Add SONATYPE_HOST=CENTRAL_PORTAL for new Maven Central infrastructure
  • Add RELEASE_SIGNING_ENABLED=true for artifact signing
  • Add POM metadata properties (name, description, license, SCM, developers) consumed by plugin

Publishing behavior

The existing .github/workflows/release.yml is already compatible. It uses publishAllPublicationsToMavenCentralRepository task and provides GPG secrets via environment variables:

  • ORG_GRADLE_PROJECT_mavenCentralUsername
  • ORG_GRADLE_PROJECT_mavenCentralPassword
  • ORG_GRADLE_PROJECT_signingInMemoryKey
  • ORG_GRADLE_PROJECT_signingInMemoryKeyPassword

Local 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
    • Triggering command: /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
    • Triggering command: /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

参考https://github.com/aizuda/flowlong 完成发布到maven仓库的相关改动和配置


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 18, 2025 06:56
Co-authored-by: huayanYu <16700837+huayanYu@users.noreply.github.com>
Co-authored-by: huayanYu <16700837+huayanYu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add configuration for publishing to Maven repository Migrate to com.vanniktech.maven.publish plugin for Maven Central Portal Dec 18, 2025
Copilot AI requested a review from huayanYu December 18, 2025 07:03
@huayanYu huayanYu marked this pull request as ready for review December 18, 2025 07:07
Copilot AI review requested due to automatic review settings December 18, 2025 07:07
@huayanYu huayanYu merged commit bb7620c into master Dec 18, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread gradle.properties

POM_DEVELOPER_ID=TaoYu
POM_DEVELOPER_NAME=TaoYu
POM_DEVELOPER_URL=https://github.com/baomidou/dynamic-datasource-spring-boot-starter

Copilot AI Dec 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
POM_DEVELOPER_URL=https://github.com/baomidou/dynamic-datasource-spring-boot-starter
POM_DEVELOPER_URL=https://github.com/baomidou/dynamic-datasource-spring-boot-starter/

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants