Skip to content

Commit b58564d

Browse files
committed
HHH-19341 Use publish Gradle plugin for snapshot publishing
1 parent 9b82576 commit b58564d

File tree

4 files changed

+9
-29
lines changed

4 files changed

+9
-29
lines changed

ci/snapshot-publish.Jenkinsfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,9 @@ pipeline {
4242
withCredentials([
4343
// https://github.com/gradle-nexus/publish-plugin#publishing-to-maven-central-via-sonatype-ossrh
4444
// TODO: HHH-19309:
45-
// Once we switch to maven-central publishing (from nexus2) we need to add a new credentials
46-
// to use the following env variable names to set the user/password:
47-
// - JRELEASER_MAVENCENTRAL_USERNAME
48-
// - JRELEASER_MAVENCENTRAL_TOKEN
49-
// Also use the new `credentialsId` for Maven Central, e.g.:
50-
// usernamePassword(credentialsId: '???????', passwordVariable: 'JRELEASER_MAVENCENTRAL_TOKEN', usernameVariable: 'JRELEASER_MAVENCENTRAL_USERNAME'),
51-
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'JRELEASER_NEXUS2_PASSWORD', usernameVariable: 'JRELEASER_NEXUS2_USERNAME'),
45+
// Once we switch to maven-central publishing (from nexus2) we need to update credentialsId:
46+
// https://docs.gradle.org/current/samples/sample_publishing_credentials.html#:~:text=via%20environment%20variables
47+
usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'ORG_GRADLE_PROJECT_snapshotsPassword', usernameVariable: 'ORG_GRADLE_PROJECT_snapshotsUsername'),
5248
string(credentialsId: 'Hibernate-CI.github.com', variable: 'JRELEASER_GITHUB_TOKEN'),
5349
// https://docs.gradle.org/current/userguide/publishing_gradle_plugins.html#account_setup
5450
usernamePassword(credentialsId: 'gradle-plugin-portal-api-key', passwordVariable: 'GRADLE_PUBLISH_SECRET', usernameVariable: 'GRADLE_PUBLISH_KEY'),

jreleaser.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@ deploy:
2727
releaseRepository: false
2828
stagingRepositories:
2929
- target/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-
- target/staging-deploy/maven
4030
mavenCentral:
4131
maven-central:
4232
# TODO: HHH-19309: Change to RELEASE once switching to Maven-Central:
@@ -49,15 +39,3 @@ deploy:
4939
- target/staging-deploy/maven
5040
# Deployment identifier used for publication.
5141
# deploymentId: dd9991b0-18a7-41e7-b1fe-37b8ea936f85
52-
maven-central-snapshot:
53-
# TODO: HHH-19309: Change to SNAPSHOT once switching to Maven-Central:
54-
active: NEVER
55-
url: https://central.sonatype.com/api/v1/publisher
56-
snapshotSupported: true
57-
applyMavenCentralRules: true
58-
javadocJar: false
59-
sign: false
60-
stagingRepositories:
61-
- target/staging-deploy/maven
62-
# Deployment identifier used for publication.
63-
# deploymentId: dd9991b0-18a7-41e7-b1fe-37b8ea936f85

local-build-plugins/src/main/groovy/local.publishing.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ publishingExtension.repositories {
6767
name = "staging"
6868
url = rootProject.layout.buildDirectory.dir("staging-deploy${File.separator}maven")
6969
}
70+
maven {
71+
name = 'snapshots'
72+
url = "https://oss.sonatype.org/content/repositories/snapshots/"
73+
}
7074
}
7175

7276
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

release/README.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ Start the appropriate Jenkins https://ci.hibernate.org/view/Release/job/hibernat
4444
NOTE: When a release is started, the job coordinates with the unified Hibernate https://github.com/hibernate/hibernate-release-scripts[release scripts] in a number of stages and steps,
4545
calling tasks on this module's link:./release.gradle[Gradle script] and leveraging link:../jreleaser.yml[JReleaser configuration].
4646

47+
NOTE: Snapshot releases are not relying on JReleaser but on built-in Gradle publish plugin. See the link:../ci/snapshot-publish.Jenkinsfile[Jenkinsfile].
48+
4749
At a high-level, this process:
4850

4951
* builds and verifies the individual modules

0 commit comments

Comments
 (0)