mvn versions:set -DnewVersion=<NEW-VERSION>Commit and tag the version. Then push and create a GitHub release.
Finally, publishing to Nexus and Maven Central is automatically triggered by creating a GitHub release using GitHub Actions.
mvn versions:set -DnewVersion=<NEW-VERSION With Minor +1 and -SNAPSHOT>Commit and push.
Publish requires following secrets:
OSSRH_USERNAMEthe Sonatype usernameOSSRH_TOKENthe Sonatype tokenOSSRH_GPG_SECRET_KEYthe gpg private key used to sign packagesOSSRH_GPG_SECRET_KEY_PASSWORDthe gpg private key password
These are stored in GitHub organisation's secrets.