diff --git a/ci/release/Jenkinsfile b/ci/release/Jenkinsfile
index 1358405a6b..88c6b54d98 100644
--- a/ci/release/Jenkinsfile
+++ b/ci/release/Jenkinsfile
@@ -51,6 +51,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') {
@@ -75,6 +80,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',
@@ -84,11 +92,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'),
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']) {
sh 'cat $HOME/.ssh/config'
diff --git a/pom.xml b/pom.xml
index 6f34fe5fc2..e7b1775aaf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,13 +25,13 @@
jboss-parent
49
-
+
org.hibernate.tool
hibernate-tools-parent
6.4.11-SNAPSHOT
pom
-
+
Hibernate Tools Parent Project
http://hibernate.org/tools/
@@ -117,16 +117,20 @@
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/
+
11
11
3.9.7
-
+
@@ -245,16 +249,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}
+
@@ -332,4 +336,28 @@
+
+
+ release
+
+
+ performRelease
+ true
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+ ${local.staging.releases.repo.id}::${local.staging.releases.repo.url}
+
+
+
+
+
+
+