diff --git a/ci/release/Jenkinsfile b/ci/release/Jenkinsfile
index c3434b9920..46fe3ad3a1 100644
--- a/ci/release/Jenkinsfile
+++ b/ci/release/Jenkinsfile
@@ -1,12 +1,12 @@
/*
* Hibernate Tools, Tooling for your Hibernate Projects
- *
+ *
* Copyright 2016-2024 Red Hat, Inc.
*
- * Licensed under the GNU Lesser General Public License (LGPL),
+ * Licensed under the GNU Lesser General Public License (LGPL),
* version 2.1 or later (the "License").
* You may not use this file except in compliance with the License.
- * You may read the licence in the 'lgpl.txt' file in the root folder of
+ * You may read the licence in the 'lgpl.txt' file in the root folder of
* project or obtain a copy at
*
* http://www.gnu.org/licenses/lgpl-2.1.html
@@ -51,6 +51,11 @@ pipeline {
defaultValue: false,
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 68e26ffa9f..76980ff553 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,13 +9,13 @@
jboss-parent
48
-
+
org.hibernate
hibernate-tools-parent
5.3.38-SNAPSHOT
pom
-
+
Hibernate Tools Parent Project
@@ -60,16 +60,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/
+
1.8
1.8
3.9.7
-
+
@@ -145,7 +149,7 @@
org.hibernate
- hibernate-tools-tests-common
+ hibernate-tools-tests-common
${project.version}
@@ -174,16 +178,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}
+
@@ -261,4 +265,28 @@
+
+
+ release
+
+
+ performRelease
+ true
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+
+ ${local.staging.releases.repo.id}::${local.staging.releases.repo.url}
+
+
+
+
+
+
+