diff --git a/ci/release/Jenkinsfile b/ci/release/Jenkinsfile index 2efd28425b..86ab214a43 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'), 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 5383227002..9d9362edce 100644 --- a/pom.xml +++ b/pom.xml @@ -25,13 +25,13 @@ jboss-parent 49 - + org.hibernate.tool hibernate-tools-parent 6.6.18-SNAPSHOT pom - + Hibernate Tools Parent Project http://hibernate.org/tools/ @@ -119,16 +119,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 - + @@ -247,16 +251,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} + @@ -334,4 +338,28 @@ + + + release + + + performRelease + true + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + ${local.staging.releases.repo.id}::${local.staging.releases.repo.url} + + + + + + +