1616
1717plugins {
1818 // This adds tasks to auto close or release nexus staging repos
19- // see https://github.com/Codearte/ gradle-nexus-staging- plugin/
20- id ' io.codearte. nexus-staging '
19+ // see https://github.com/gradle-nexus/publish- plugin
20+ id ' io.github.gradle- nexus.publish-plugin '
2121 // OWASP Security Vulnerability Detection
2222 id ' org.owasp.dependencycheck'
2323}
@@ -30,38 +30,26 @@ allprojects {
3030 version = findProperty(' overrideVersion' ) ?: ehcacheVersion
3131}
3232
33- if (deployUrl. contains(' nexus' )) {
34- // internal terracotta config, shorten url for this plugin to end at local/
35- project. nexusStaging {
36- serverUrl = deployUrl. replaceAll(~/ local\/ .*$/ , " local/" )
37- packageGroup = ' Ehcache OS' // internal staging repository name
33+ nexusPublishing {
34+ repositories {
35+ sonatype {
36+ username = sonatypeUser
37+ password = sonatypePwd
38+ packageGroup = ' org.ehcache' // Sonatype staging repository name
39+ }
40+ nexus {
41+ username = tcDeployUser
42+ password = tcDeployPassword
43+ packageGroup = ' Ehcache OS' // internal staging repository name
44+ nexusUrl. set(uri(' https://nexus.terracotta.eur.ad.sag:8443/service/local/' ))
45+ snapshotRepositoryUrl. set(uri(" https://nexus.terracotta.eur.ad.sag:8443/content/repositories/terracotta-os-snapshots/" ))
46+ }
3847 }
39- ext {
40- deployUser = tcDeployUser
41- deployPwd = tcDeployPassword
42- }
43- } else {
44- project. nexusStaging {
45- packageGroup = ' org.ehcache' // Sonatype staging repository name
46- }
47- ext {
48- deployUser = sonatypeUser
49- deployPwd = sonatypePwd
50- }
51- }
52-
53- nexusStaging {
54- username = project. ext. deployUser
55- password = project. ext. deployPwd
56- logger. debug(" Nexus Staging: Using login ${ username} and url ${ serverUrl} " )
5748 // Sonatype is often very slow in these operations:
58- delayBetweenRetriesInMillis = (findProperty(' delayBetweenRetriesInMillis' ) ?: ' 10000' ) as int
59- numberOfRetries = (findProperty(' numberOfRetries' ) ?: ' 100' ) as int
60- }
61-
62- tasks. named(' closeAndReleaseRepository' ) {
63- // Disable automatic promotion for added safety
64- enabled = false ;
49+ transitionCheckOptions {
50+ delayBetween = Duration . ofSeconds((findProperty(' delayBetweenRetriesInSeconds' ) ?: ' 10' ) as int )
51+ maxRetries = (findProperty(' numberOfRetries' ) ?: ' 100' ) as int
52+ }
6553}
6654
6755assert (JavaVersion . current(). isJava8Compatible()) : ' The Ehcache 3 build requires Java 8+ to run'
0 commit comments