diff --git a/ci/release/Jenkinsfile b/ci/release/Jenkinsfile
index 6bcb7cc0e9..30e43597e2 100644
--- a/ci/release/Jenkinsfile
+++ b/ci/release/Jenkinsfile
@@ -47,6 +47,11 @@ pipeline {
defaultValue: true,
description: 'If true, just simulate the release, without pushing any commits or tags, and without uploading any artifacts or documentation.'
)
+ booleanParam(
+ name: 'RELEASE_PUBLISH_AUTOMATICALLY',
+ defaultValue: true,
+ description: 'If true, staging repository will get closed and published automatically, otherwise the artifacts will only be uploaded and the publishing (releasing the staging repository) has to be performed manually at Maven Central portal.'
+ )
}
stages {
stage('Release') {
@@ -71,6 +76,9 @@ pipeline {
def releaseVersion = Version.parseReleaseVersion(params.RELEASE_VERSION)
def developmentVersion = Version.parseDevelopmentVersion(params.DEVELOPMENT_VERSION)
env.JRELEASER_DRY_RUN = params.RELEASE_DRY_RUN
+ if (!params.RELEASE_PUBLISH_AUTOMATICALLY) {
+ env.JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_STAGE='UPLOAD'
+ }
echo "Performing full release for version ${releaseVersion.toString()}"
withMaven(mavenSettingsConfig: params.RELEASE_DRY_RUN ? null : 'ci-hibernate.deploy.settings.maven',
@@ -80,11 +88,7 @@ pipeline {
// 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
- usernamePassword(credentialsId: 'ossrh.sonatype.org', passwordVariable: 'JRELEASER_NEXUS2_PASSWORD', usernameVariable: 'JRELEASER_NEXUS2_USERNAME'),
+ usernamePassword(credentialsId: 'central.sonatype.com', passwordVariable: 'JRELEASER_MAVENCENTRAL_TOKEN', usernameVariable: 'JRELEASER_MAVENCENTRAL_USERNAME'),
usernamePassword(credentialsId: 'gradle-plugin-portal-api-key', passwordVariable: 'GRADLE_PUBLISH_SECRET', usernameVariable: 'GRADLE_PUBLISH_KEY'),
string(credentialsId: 'Hibernate-CI.github.com', variable: 'JRELEASER_GITHUB_TOKEN')]) {
sshagent(['ed25519.Hibernate-CI.github.com', 'hibernate.filemgmt.jboss.org', 'hibernate-ci.frs.sourceforge.net']) {
diff --git a/pom.xml b/pom.xml
index e1d3fcfe6d..9d460d4e5f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -121,9 +121,13 @@
staging-deploy
Local Staging Directory Releases Repository
file:${maven.multiModuleProjectDirectory}/target/staging-deploy/maven
- ossrh
- Sonatype OSSRH Snapshots
- https://oss.sonatype.org/content/repositories/snapshots
+ central-releases
+ Maven Central Releases Repository
+ https://central.sonatype.com/api/v1/publisher/
+ central-snapshots
+ Maven Central Snapshots Repository
+ https://central.sonatype.com/repository/maven-snapshots/
+
17
17
@@ -263,16 +267,16 @@
-
- ${local.staging.releases.repo.id}
- ${local.staging.releases.repo.name}
- ${local.staging.releases.repo.url}
-
-
- ${ossrh.snapshots.repo.id}
- ${ossrh.snapshots.repo.name}
- ${ossrh.snapshots.repo.url}
-
+
+ ${central.releases.repo.id}
+ ${central.releases.repo.name}
+ ${central.releases.repo.url}
+
+
+ ${central.snapshots.repo.id}
+ ${central.snapshots.repo.name}
+ ${central.snapshots.repo.url}
+
@@ -349,4 +353,29 @@
+
+
+
+ release
+
+
+ performRelease
+ true
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+ ${local.staging.releases.repo.id}::${local.staging.releases.repo.url}
+
+
+
+
+
+
+