Skip to content

Commit 1500637

Browse files
committed
[#2222] Adjust snapshot publishing to use the publish plugin instead of JReleaser
1 parent e254a0f commit 1500637

File tree

3 files changed

+11
-28
lines changed

3 files changed

+11
-28
lines changed

ci/snapshot-publish.Jenkinsfile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,15 @@ pipeline {
4141
script {
4242
withCredentials([
4343
// https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-ossrh
44-
// TODO: Once we switch to maven-central publishing (from nexus2) we need to add a new credentials
45-
// to use the following env variable names to set the user/password:
46-
// - JRELEASER_MAVENCENTRAL_USERNAME
47-
// - JRELEASER_MAVENCENTRAL_TOKEN
48-
// Also use the new `credentialsId` for Maven Central, e.g.:
49-
// usernamePassword(credentialsId: '???????', passwordVariable: 'JRELEASER_MAVENCENTRAL_TOKEN', usernameVariable: 'JRELEASER_MAVENCENTRAL_USERNAME'),
50-
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'JRELEASER_NEXUS2_PASSWORD', usernameVariable: 'JRELEASER_NEXUS2_USERNAME'),
44+
// TODO: Once we switch to maven-central publishing (from nexus2) we need to update credentialsId:
45+
// https://docs.gradle.org/current/samples/sample_publishing_credentials.html#:~:text=via%20environment%20variables
46+
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'ORG_GRADLE_PROJECT_snapshotsPassword', usernameVariable: 'ORG_GRADLE_PROJECT_snapshotsUsername'),
5147
gitUsernamePassword(credentialsId: 'username-and-token.Hibernate-CI.github.com', gitToolName: 'Default'),
5248
string(credentialsId: 'Hibernate-CI.github.com', variable: 'JRELEASER_GITHUB_TOKEN')
5349
]) {
5450
checkoutReleaseScripts()
5551
def version = sh(
56-
script: ".release/scripts/determine-current-version.sh orm",
52+
script: ".release/scripts/determine-current-version.sh reactive",
5753
returnStdout: true
5854
).trim()
5955
echo "Current version: '${version}'"

jreleaser.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@ deploy:
2727
releaseRepository: false
2828
stagingRepositories:
2929
- build/staging-deploy/maven
30-
maven-central-snapshot:
31-
active: SNAPSHOT
32-
url: https://oss.sonatype.org/service/local
33-
snapshotUrl: https://oss.sonatype.org/content/repositories/snapshots/
34-
closeRepository: true
35-
releaseRepository: true
36-
javadocJar: false
37-
sign: false
38-
stagingRepositories:
39-
- build/staging-deploy/maven
4030
mavenCentral:
4131
maven-central:
4232
# TODO: Change to RELEASE once switching to Maven-Central:
@@ -47,13 +37,3 @@ deploy:
4737
applyMavenCentralRules: true
4838
stagingRepositories:
4939
- build/staging-deploy/maven
50-
maven-central-snapshot:
51-
# TODO: Change to SNAPSHOT once switching to Maven-Central:
52-
active: NEVER
53-
url: https://central.sonatype.com/api/v1/publisher
54-
snapshotSupported: true
55-
applyMavenCentralRules: true
56-
javadocJar: false
57-
sign: false
58-
stagingRepositories:
59-
- build/staging-deploy/maven

publish.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,12 @@ publishing {
7979
name = "staging"
8080
url = rootProject.layout.buildDirectory.dir("staging-deploy${File.separator}maven")
8181
}
82+
maven {
83+
name = 'snapshots'
84+
url = "https://oss.sonatype.org/content/repositories/snapshots/"
85+
// So that Gradle uses the `ORG_GRADLE_PROJECT_snapshotsPassword` / `ORG_GRADLE_PROJECT_snapshotsUsername`
86+
// env variables to read the username/password for the `snapshots` repository publishing:
87+
credentials(PasswordCredentials)
88+
}
8289
}
8390
}

0 commit comments

Comments
 (0)