Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 1d4057f

Browse files
committed
Migrate to new sonatype infrastructure.
1 parent 771aaf1 commit 1d4057f

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

Jenkinsfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,15 @@ pipeline {
106106

107107
environment {
108108
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
109-
SONATYPE = credentials('oss-token')
109+
SONATYPE = credentials('oss-login')
110110
KEYRING = credentials('spring-signing-secring.gpg')
111111
PASSPHRASE = credentials('spring-gpg-passphrase')
112112
}
113113

114114
steps {
115115
script {
116-
// Warm up this plugin quietly before using it.
117-
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -q org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version'
118-
119-
// Extract project's version number
120116
PROJECT_VERSION = sh(
121-
script: 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version -o | grep -v INFO',
117+
script: "ci/version.sh",
122118
returnStdout: true
123119
).trim()
124120

@@ -134,6 +130,12 @@ pipeline {
134130

135131
if (RELEASE_TYPE == 'release') {
136132
sh "PROFILE=central USERNAME=${SONATYPE_USR} PASSWORD=${SONATYPE_PSW} ci/build-and-deploy-to-maven-central.sh ${PROJECT_VERSION}"
133+
134+
slackSend(
135+
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger',
136+
channel: '#spring-session-bot',
137+
message: "@here Spring Session for MongoDB ${PROJECT_VERSION} is staged on Sonatype awaiting closure and release.")
138+
137139
} else {
138140
sh "PROFILE=${RELEASE_TYPE} ci/build-and-deploy-to-artifactory.sh"
139141
}

ci/build-and-deploy-to-maven-central.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw \
2121
-Dmaven.test.skip=true \
2222
-Dgpg.passphrase=${PASSPHRASE} \
2323
-Dgpg.secretKeyring=${GNUPGHOME}/secring.gpg \
24-
-DstagingDescription="Releasing ${PROJECT_VERSION}" \
24+
-DstagingDescription="Releasing Spring Session for MongoDB ${PROJECT_VERSION}" \
2525
clean deploy -B

ci/version.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
RAW_VERSION=`MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw \
6+
org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate \
7+
-Dexpression=project.version -q -DforceStdout`
8+
9+
# Split things up
10+
VERSION_PARTS=($RAW_VERSION)
11+
12+
# Grab the last part, which is the actual version number.
13+
echo ${VERSION_PARTS[${#VERSION_PARTS[@]}-1]}
14+

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -582,10 +582,10 @@
582582
<extensions>true</extensions>
583583
<configuration>
584584
<serverId>sonatype</serverId>
585-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
586-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
585+
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
586+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
587587
<keepStagingRepositoryOnFailure>true</keepStagingRepositoryOnFailure>
588-
<skipStagingRepositoryClose>false</skipStagingRepositoryClose>
588+
<skipStagingRepositoryClose>true</skipStagingRepositoryClose>
589589
</configuration>
590590
</plugin>
591591
</plugins>
@@ -626,7 +626,7 @@
626626
<distributionManagement>
627627
<repository>
628628
<id>sonatype</id>
629-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
629+
<url>https://s01.oss.sonatype.org//service/local/staging/deploy/maven2/</url>
630630
</repository>
631631
</distributionManagement>
632632

0 commit comments

Comments
 (0)