Skip to content

Adds GitHub Actions for publishing to Maven Central#772

Merged
aaronzi merged 5 commits intoeclipse-basyx:mainfrom
aaronzi:main
Jun 12, 2025
Merged

Adds GitHub Actions for publishing to Maven Central#772
aaronzi merged 5 commits intoeclipse-basyx:mainfrom
aaronzi:main

Conversation

@aaronzi
Copy link
Copy Markdown
Member

@aaronzi aaronzi commented Jun 12, 2025

This PR adds two new GitHub actions workflows:

  • Snapshot releases to Maven Central when merging PRs
  • Releases to Maven Central when creating releases on GitHub

The Maven GPG plugin was added to the parent pom.xml as well as the Central Publishing Plugin. Both are part of the MavenCentral profile that is explicitly triggered only by the two newly added workflows.

In addition to that, the repositories section got removed as well as the Sonatype plugin using the deprecated OSSRH.

@aaronzi aaronzi requested a review from Copilot June 12, 2025 16:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 enables automated publishing of snapshot and release artifacts to Maven Central by adding two GitHub Actions workflows and updating the parent POM.

  • Introduces central-snapshot.yml to deploy snapshots on pushes to main
  • Adds central-release.yml to publish releases when a GitHub Release is published
  • Updates pom.xml to use the new central-publishing-maven-plugin, configures GPG signing, and removes the deprecated OSSRH plugin and manual repository definitions

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pom.xml Added MavenCentral profile with central-publishing plugin and GPG signing; removed old OSSRH plugin and hardcoded repositories
.github/workflows/central-snapshot.yml New workflow for snapshot deployment to Maven Central on main pushes
.github/workflows/central-release.yml New workflow for release deployment to Maven Central on GitHub releases
Comments suppressed due to low confidence (4)

.github/workflows/central-snapshot.yml:39

  • The gpg-passphrase value isn’t referencing the secret. It should be gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }} (or whichever secret holds your passphrase) so that Setup Java can retrieve it correctly.
gpg-passphrase: MAVEN_GPG_PASSPHRASE

.github/workflows/central-release.yml:24

  • The gpg-passphrase field needs to reference the actual secret, for example gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }} so the action can import the key successfully.
gpg-passphrase: MAVEN_GPG_PASSPHRASE

.github/workflows/central-snapshot.yml:42

  • Using -PperformRelease=true is incorrect: -P activates a profile, while you need to set the performRelease property so that the MavenCentral profile activates. Change to -DperformRelease=true.
run: mvn --batch-mode deploy -DskipTests -PperformRelease=true

.github/workflows/central-release.yml:30

  • This command also misuses -P; you should pass the performRelease property with -DperformRelease=true to trigger the MavenCentral profile, not -PperformRelease=true.
run: mvn --batch-mode deploy -DskipTests -PperformRelease=true

@aaronzi aaronzi merged commit 5da8c1b into eclipse-basyx:main Jun 12, 2025
41 checks passed
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