Skip to content

Migrate to com.vanniktech.maven.publish for Maven Central - #30

Merged
AkaZver merged 1 commit into
masterfrom
feature/update-29.07.2026-3
Jul 29, 2026
Merged

AkaZver merged 1 commit into
masterfrom
feature/update-29.07.2026-3

Conversation

@AkaZver

@AkaZver AkaZver commented Jul 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

Migrate to the official com.vanniktech.maven.publish plugin for Maven Central publishing instead of manual curl-based configuration.

Changes

build.gradle

  • Add com.vanniktech.maven.publish plugin version 0.37.0
  • Remove maven-publish and signing plugins (no longer needed)
  • Remove withJavadocJar() (plugin handles this automatically)
  • Remove publishing and signing blocks (~50 lines)
  • Add mavenPublishing block with configuration:
    • publishToMavenCentral(true) — automatic publishing
    • signAllPublications() — GPG signing
    • POM metadata with inceptionYear = '2021'

.github/workflows/main.yml

  • Simplify publish-maven-central job
  • Remove 4 steps: Publish to local repository, Create bundle, Verify bundle structure, Upload to Central Portal
  • Add single step: Publish to Maven Central
  • Use ORG_GRADLE_PROJECT_* environment variables for secrets

Benefits

  • Less code: removed ~50 lines of manual configuration
  • Reliability: using proven solution with 1.7k stars on GitHub
  • Simplicity: single command ./gradlew publishToMavenCentral instead of complex curl workflow
  • Automation: plugin handles validation, publishing, and status monitoring
  • Official recommendation: Sonatype recommends this plugin in their documentation

Testing

  • ./gradlew clean build — BUILD SUCCESSFUL
  • Configuration is correct, all tests pass
  • Secrets are passed via environment variables

Next Steps

After merging:

  1. Create tag 2.0.3 to test new configuration
  2. Verify publishing to Maven Central
  3. Ensure artifacts appear on mvnrepository.com

…ishing

- Replace manual publishing/signing configuration with com.vanniktech.maven.publish plugin
- Remove maven-publish and signing plugins (handled by vanniktech plugin)
- Remove withJavadocJar() (plugin handles this automatically)
- Add mavenPublishing block with automatic publishing enabled
- Simplify GitHub Actions workflow (single command instead of manual bundle creation)
- Use ORG_GRADLE_PROJECT_* environment variables for secrets
- Add inceptionYear = 2021 to POM metadata

Benefits:
- Less code (~50 lines removed)
- Official recommended solution by Sonatype
- Automatic validation and status monitoring
- More reliable publishing process
@sonarqubecloud

Copy link
Copy Markdown

@AkaZver
AkaZver merged commit ada20a5 into master Jul 29, 2026
6 checks passed
@AkaZver
AkaZver deleted the feature/update-29.07.2026-3 branch July 29, 2026 08:21
@AkaZver AkaZver self-assigned this Jul 29, 2026
@AkaZver AkaZver added the bug Something isn't working label Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant