Skip to content

Adjust snapshot publishing to use the publish plugin instead of JReleaser #2245

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
May 5, 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
12 changes: 4 additions & 8 deletions ci/snapshot-publish.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,15 @@ pipeline {
script {
withCredentials([
// https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-ossrh
// 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'),
// TODO: Once we switch to maven-central publishing (from nexus2) we need to update credentialsId:
// https://docs.gradle.org/current/samples/sample_publishing_credentials.html#:~:text=via%20environment%20variables
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'ORG_GRADLE_PROJECT_snapshotsPassword', usernameVariable: 'ORG_GRADLE_PROJECT_snapshotsUsername'),
gitUsernamePassword(credentialsId: 'username-and-token.Hibernate-CI.github.com', gitToolName: 'Default'),
string(credentialsId: 'Hibernate-CI.github.com', variable: 'JRELEASER_GITHUB_TOKEN')
]) {
checkoutReleaseScripts()
def version = sh(
script: ".release/scripts/determine-current-version.sh orm",
script: ".release/scripts/determine-current-version.sh reactive",
returnStdout: true
).trim()
echo "Current version: '${version}'"
Expand Down
20 changes: 0 additions & 20 deletions jreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ deploy:
releaseRepository: false
stagingRepositories:
- build/staging-deploy/maven
maven-central-snapshot:
active: SNAPSHOT
url: https://oss.sonatype.org/service/local
snapshotUrl: https://oss.sonatype.org/content/repositories/snapshots/
closeRepository: true
releaseRepository: true
javadocJar: false
sign: false
stagingRepositories:
- build/staging-deploy/maven
mavenCentral:
maven-central:
# TODO: Change to RELEASE once switching to Maven-Central:
Expand All @@ -47,13 +37,3 @@ deploy:
applyMavenCentralRules: true
stagingRepositories:
- build/staging-deploy/maven
maven-central-snapshot:
# TODO: Change to SNAPSHOT once switching to Maven-Central:
active: NEVER
url: https://central.sonatype.com/api/v1/publisher
snapshotSupported: true
applyMavenCentralRules: true
javadocJar: false
sign: false
stagingRepositories:
- build/staging-deploy/maven
7 changes: 7 additions & 0 deletions publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,12 @@ publishing {
name = "staging"
url = rootProject.layout.buildDirectory.dir("staging-deploy${File.separator}maven")
}
maven {
name = 'snapshots'
url = "https://oss.sonatype.org/content/repositories/snapshots/"
// So that Gradle uses the `ORG_GRADLE_PROJECT_snapshotsPassword` / `ORG_GRADLE_PROJECT_snapshotsUsername`
// env variables to read the username/password for the `snapshots` repository publishing:
credentials(PasswordCredentials)
}
}
}
Loading