File tree Expand file tree Collapse file tree 2 files changed +34
-5
lines changed Expand file tree Collapse file tree 2 files changed +34
-5
lines changed Original file line number Diff line number Diff line change @@ -8,15 +8,20 @@ properties(projectProperties)
8
8
def SUCCESS = hudson.model.Result . SUCCESS . toString()
9
9
currentBuild. result = SUCCESS
10
10
11
+
12
+ def ARTIFACTORY_CREDENTIALS = usernamePassword(credentialsId : ' 02bd1690-b54f-4c9f-819d-a77cb7a9822c' , usernameVariable : ' ARTIFACTORY_USERNAME' , passwordVariable : ' ARTIFACTORY_PASSWORD' )
13
+
11
14
try {
12
15
parallel check : {
13
16
stage(' Check' ) {
14
17
node {
15
18
checkout scm
16
19
sh " git clean -dfx"
17
20
try {
18
- withEnv([" JAVA_HOME=${ tool 'jdk8' } " ]) {
19
- sh " ./gradlew test --refresh-dependencies --no-daemon --stacktrace"
21
+ withCredentials([ARTIFACTORY_CREDENTIALS ]) {
22
+ withEnv([" JAVA_HOME=${ tool 'jdk8' } " ]) {
23
+ sh " ./gradlew test -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD --refresh-dependencies --no-daemon --stacktrace"
24
+ }
20
25
}
21
26
} catch (Exception e) {
22
27
currentBuild. result = ' FAILED: check'
37
42
withCredentials([file(credentialsId : ' spring-signing-secring.gpg' , variable : ' SIGNING_KEYRING_FILE' )]) {
38
43
withCredentials([string(credentialsId : ' spring-gpg-passphrase' , variable : ' SIGNING_PASSWORD' )]) {
39
44
withCredentials([usernamePassword(credentialsId : ' oss-token' , passwordVariable : ' OSSRH_PASSWORD' , usernameVariable : ' OSSRH_USERNAME' )]) {
40
- withCredentials([usernamePassword( credentialsId : ' 02bd1690-b54f-4c9f-819d-a77cb7a9822c ' , usernameVariable : ' ARTIFACTORY_USERNAME ' , passwordVariable : ' ARTIFACTORY_PASSWORD ' ) ]) {
45
+ withCredentials([ARTIFACTORY_CREDENTIALS ]) {
41
46
withEnv([" JAVA_HOME=${ tool 'jdk8' } " ]) {
42
47
sh " ./gradlew deployArtifacts finalizeDeployArtifacts -Psigning.secretKeyRingFile=$SIGNING_KEYRING_FILE -Psigning.keyId=$SPRING_SIGNING_KEYID -Psigning.password='$SIGNING_PASSWORD ' -PossrhUsername=$OSSRH_USERNAME -PossrhPassword=$OSSRH_PASSWORD -PartifactoryUsername=$ARTIFACTORY_USERNAME -PartifactoryPassword=$ARTIFACTORY_PASSWORD --refresh-dependencies --no-daemon --stacktrace"
43
48
}
Original file line number Diff line number Diff line change 1
1
buildscript {
2
2
repositories {
3
- maven { url " https://repo.spring.io/plugins-release" }
4
- maven { url " https://repo.spring.io/plugins-snapshot" }
3
+ maven {
4
+ url = ' https://repo.spring.io/plugins-snapshot'
5
+ if (project. hasProperty(' artifactoryUsername' )) {
6
+ credentials {
7
+ username " $artifactoryUsername "
8
+ password " $artifactoryPassword "
9
+ }
10
+ }
11
+ }
5
12
}
6
13
dependencies {
7
14
classpath " com.github.ben-manes:gradle-versions-plugin:0.17.0"
@@ -203,3 +210,20 @@ artifacts {
203
210
archives project(' :docs' ). docsZip
204
211
archives project(' :docs' ). schemaZip
205
212
}
213
+
214
+
215
+ if (project. hasProperty(' artifactoryUsername' )) {
216
+ allprojects { project ->
217
+ project. repositories { repos ->
218
+ all { repo ->
219
+ if (! repo. url. toString(). startsWith(" https://repo.spring.io/" )) {
220
+ return ;
221
+ }
222
+ repo. credentials {
223
+ username = artifactoryUsername
224
+ password = artifactoryPassword
225
+ }
226
+ }
227
+ }
228
+ }
229
+ }
You can’t perform that action at this time.
0 commit comments