Skip to content

Add maven-central publishing placeholder #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ci/release/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,14 @@ pipeline {
configFile(fileId: 'release.config.ssh.knownhosts', targetLocation: env.HOME + '/.ssh/known_hosts')]) {
// using MAVEN_GPG_PASSPHRASE (the default env variable name for passphrase in maven gpg plugin)
withCredentials([file(credentialsId: 'release.gpg.private-key', variable: 'RELEASE_GPG_PRIVATE_KEY_PATH'),
string(credentialsId: 'release.gpg.passphrase', variable: 'JRELEASER_GPG_PASSPHRASE'),
// TODO: Once we switch to maven-central publishing (from nexus2) we need to add a new credentials
// to use the following env variable names to set the user/password:
// - JRELEASER_MAVENCENTRAL_USERNAME
// - JRELEASER_MAVENCENTRAL_TOKEN
// Also use the new `credentialsId` for Maven Central, e.g.:
// usernamePassword(credentialsId: '???????', passwordVariable: 'JRELEASER_MAVENCENTRAL_TOKEN', usernameVariable: 'JRELEASER_MAVENCENTRAL_USERNAME'),
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'JRELEASER_NEXUS2_PASSWORD', usernameVariable: 'JRELEASER_NEXUS2_USERNAME'),
string(credentialsId: 'release.gpg.passphrase', variable: 'JRELEASER_GPG_PASSPHRASE'),
string(credentialsId: 'Hibernate-CI.github.com', variable: 'JRELEASER_GITHUB_TOKEN')]) {
sshagent(['ed25519.Hibernate-CI.github.com']) {
sh 'cat $HOME/.ssh/config'
Expand Down
16 changes: 13 additions & 3 deletions jreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,28 @@ release:
# File signing is always active
signing:
mode: COMMAND
active: ALWAYS
active: RELEASE
armored: true

# Deploy JARs and POMs to Maven Central
deploy:
maven:
nexus2:
maven-central:
active: ALWAYS
active: RELEASE
url: https://oss.sonatype.org/service/local
snapshotUrl: https://oss.sonatype.org/content/repositories/snapshots/
closeRepository: true
releaseRepository: true
stagingRepositories:
- build/staging-deploy/maven
mavenCentral:
maven-central:
# TODO: Change to RELEASE once switching to Maven-Central:
active: NEVER
url: https://central.sonatype.com/api/v1/publisher
snapshotSupported: false
applyMavenCentralRules: true
stagingRepositories:
- build/staging-deploy/maven
# Deployment identifier used for publication.
# deploymentId: dd9991b0-18a7-41e7-b1fe-37b8ea936f85