1- import java.util.regex.Pattern
2-
31buildscript {
42 ext. kotlinVersion = ' 2.1.10'
53 ext. isCI = System . getenv(' GITHUB_ACTION' )
@@ -732,24 +730,24 @@ def generateAttributes() {
732730 return [
733731 ' project-version' : project. version,
734732 ' spring-integration-docs' : " $springDocs /spring-integration/reference" . toString(),
735- ' spring-framework-docs' : " $springDocs /spring-framework/reference/%s " . formatted( generateVersionWithoutPatch(springVersion)),
733+ ' spring-framework-docs' : " $springDocs /spring-framework/reference/${ generateVersionWithoutPatch(springVersion)} " . toString( ),
736734 ' spring-retry-java-docs' : " $springDocs /spring-retry/docs/$springRetryVersion /apidocs" . toString(),
737735 ' javadoc-location-org-springframework-transaction' : " $springDocs /spring-framework/docs/$springVersion /javadoc-api" . toString(),
738736 ' javadoc-location-org-springframework-amqp' : " $springDocs /spring-amqp/docs/$project . version /api" . toString(),
739- ' micrometer-docs' : " $micrometerDocsPrefix /micrometer/reference/%s " . formatted( generateVersionWithoutPatch(micrometerVersion)),
740- ' micrometer-tracing-docs' : " $micrometerDocsPrefix /tracing/reference/%s " . formatted( generateVersionWithoutPatch(micrometerTracingVersion))
737+ ' micrometer-docs' : " $micrometerDocsPrefix /micrometer/reference/${ generateVersionWithoutPatch(micrometerVersion)} " . toString( ),
738+ ' micrometer-tracing-docs' : " $micrometerDocsPrefix /tracing/reference/${ generateVersionWithoutPatch(micrometerTracingVersion)} " . toString( )
741739 ]
742740}
743741
744742static String generateVersionWithoutPatch (String version ) {
745743
746- def matcher = Pattern . compile( " ^(\\ d+.\\ d+).\\ d+(-SNAPSHOT)?\$ " ) . matcher(version);
747- if (matcher. find() ) {
744+ def matcher = version =~ / ^(\d +.\d +).\d +(-SNAPSHOT)?$ /
745+ if (matcher) {
748746
749- return matcher. group( 2 ) == null
750- ? matcher. group( 1 )
751- : matcher. group( 1 ) + matcher. group( 2 )
747+ return matcher[ 0 ][ 2 ] == null
748+ ? matcher[ 0 ][ 1 ]
749+ : matcher[ 0 ][ 1 ] + matcher[ 0 ][ 2 ]
752750 }
753751
754752 return version
755- }
753+ }
0 commit comments