Adds GitHub Actions for publishing to Maven Central#772
Merged
aaronzi merged 5 commits intoeclipse-basyx:mainfrom Jun 12, 2025
Merged
Adds GitHub Actions for publishing to Maven Central#772aaronzi merged 5 commits intoeclipse-basyx:mainfrom
aaronzi merged 5 commits intoeclipse-basyx:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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.ymlto deploy snapshots on pushes tomain - Adds
central-release.ymlto publish releases when a GitHub Release is published - Updates
pom.xmlto use the newcentral-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-passphrasevalue isn’t referencing the secret. It should begpg-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-passphrasefield needs to reference the actual secret, for examplegpg-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=trueis incorrect:-Pactivates a profile, while you need to set theperformReleaseproperty so that theMavenCentralprofile 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 theperformReleaseproperty with-DperformRelease=trueto trigger the MavenCentral profile, not-PperformRelease=true.
run: mvn --batch-mode deploy -DskipTests -PperformRelease=true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds two new GitHub actions workflows:
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
repositoriessection got removed as well as the Sonatype plugin using the deprecated OSSRH.