Skip to content

Publish to Maven Central with JReleaser - #20

Merged
komamitsu merged 3 commits into
mainfrom
use-jreleaser
Sep 27, 2026
Merged

komamitsu merged 3 commits into
mainfrom
use-jreleaser

Conversation

@komamitsu

Copy link
Copy Markdown
Owner

Summary

  • Replace the vanniktech plugin with maven-publish and JReleaser. Gradle stages the publications in build/staging-deploy, and JReleaser signs them and uploads them to the Central Portal.
  • Add a release workflow that runs on a v*.*.* tag push. It builds the project, publishes to Maven Central and creates a GitHub release. Credentials come from repository secrets.
  • Replace the deprecated tasks.registering delegate for generatePackageVersion.

Testing

  • ./gradlew clean build passes.
  • publishAllPublicationsToStagingRepository stages the jar, sources jar, javadoc jar, POM and Gradle module metadata.
  • A jreleaserDeploy --dryrun with a temporary release version and a throwaway signing key passes the Maven Central POM checks, signs every staged file and builds the upload bundle. Nothing was uploaded.

One Gradle deprecation warning remains (Project.getProperties). It comes from JReleaser's own plugin code, not from this build script.

Replace the vanniktech plugin with maven-publish and JReleaser. Gradle stages the
publications in build/staging-deploy, and JReleaser signs them and uploads them to the
Central Portal. A v*.*.* tag push runs the new release workflow, which reads the
Portal token and GPG key from repository secrets.

Also replace the deprecated tasks.registering delegate for generatePackageVersion.

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.

Copilot review overview

🟡 Changes recommended

The workflow permits unguarded manual publishing, and GitHub release creation is not configured.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Migrates Maven Central publishing to Gradle maven-publish and JReleaser, with automated release workflow support.

Changes:

  • Adds the JReleaser plugin.
  • Configures staged publications, signing, and Central Portal deployment.
  • Adds a tag-triggered release workflow.
File Summary Findings
gradle/​libs.versions.toml Adds the JReleaser plugin version. None
build.gradle.kts Configures publications, staging, signing, and deployment. Moderate: GitHub release provider is not configured.
.github/​workflows/​release.yml Builds and publishes tagged releases. Critical: manual dispatch can publish an unintended revision.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/release.yml Outdated
Drop the manual trigger from the release workflow. A manual run could publish whatever
branch or commit was selected. A failed tag run can still be retried with Re-run jobs.

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.

Copilot review overview

🟡 Changes recommended

Fix the tag pattern and derive or validate the release version before publishing.

Review effort: Lite
Findings: 2 High severity

Open (2)
Resolved since last review (1)

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
The published version comes from build.gradle.kts, not from the tag. A tag pushed on
a commit that still has a SNAPSHOT or different version would otherwise go on to
create a GitHub release for the wrong version.

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.

Copilot review overview

🔵 Needs a closer look

Release publishing and signing automation require final human review.

Review effort: Lite
Findings: None

Resolved since last review (2)

@komamitsu
komamitsu merged commit 5221568 into main Sep 27, 2026
5 checks passed
@komamitsu
komamitsu deleted the use-jreleaser branch September 27, 2026 08:38
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.

2 participants