From 5f06fb0bd7c1dd4a3789c2196879223f1d2284de Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Sun, 16 Feb 2025 10:41:50 +0700 Subject: [PATCH 1/5] Improve `build.gradle` for building antora Signed-off-by: Tran Ngoc Nhan --- build.gradle | 35 +++++++++++++++++-- src/reference/antora/antora-playbook.yml | 1 + src/reference/antora/antora.yml | 9 ----- .../ROOT/pages/amqp/broker-configuration.adoc | 2 +- .../modules/ROOT/pages/amqp/connections.adoc | 2 +- .../ROOT/pages/amqp/listener-queues.adoc | 2 +- .../async-annotation-driven/enable.adoc | 2 +- .../amqp/receiving-messages/micrometer.adoc | 2 +- .../ROOT/pages/amqp/request-reply.adoc | 4 +-- .../ROOT/pages/amqp/sending-messages.adoc | 2 +- .../modules/ROOT/pages/amqp/transactions.adoc | 6 ++-- .../modules/ROOT/pages/sample-apps.adoc | 2 +- 12 files changed, 45 insertions(+), 24 deletions(-) diff --git a/build.gradle b/build.gradle index 76f076efa1..fa32f31b8f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,5 @@ +import java.util.regex.Pattern + buildscript { ext.kotlinVersion = '2.1.10' ext.isCI = System.getenv('GITHUB_ACTION') @@ -84,9 +86,7 @@ antora { } tasks.named('generateAntoraYml') { - asciidocAttributes = project.provider({ - return ['project-version': project.version] - }) + asciidocAttributes = project.provider( { generateAttributes() } ) baseAntoraYmlFile = file('src/reference/antora/antora.yml') } @@ -724,3 +724,32 @@ publishing { } } } + +def generateAttributes() { + def springDocs = "https://docs.spring.io" + def micrometerDocsPrefix = "https://docs.micrometer.io" + + return [ + 'project-version': project.version, + 'spring-framework-docs': "$springDocs/spring-framework/reference/%s".formatted(generateVersionWithoutPatch(springVersion)), + 'spring-retry-java-docs': "$springDocs/spring-retry/docs/$springRetryVersion/apidocs".toString(), + 'spring-integration-docs': "$springDocs/spring-integration/reference".toString(), + 'javadoc-location-org-springframework-transaction': "$springDocs/spring-framework/docs/$springVersion/javadoc-api".toString(), + 'javadoc-location-org-springframework-amqp': "$springDocs/spring-amqp/docs/$project.version/api".toString(), + 'micrometer-docs': "$micrometerDocsPrefix/micrometer/reference/%s".formatted(generateVersionWithoutPatch(micrometerVersion)), + 'micrometer-tracing-docs': "$micrometerDocsPrefix/tracing/reference/%s".formatted(generateVersionWithoutPatch(micrometerTracingVersion)) + ] +} + +static String generateVersionWithoutPatch(String version) { + + def matcher = Pattern.compile("^(\\d+.\\d+).\\d+(-SNAPSHOT)?\$").matcher(version); + if(matcher.find()) { + + return matcher.group(2) == null + ? matcher.group(1) + : matcher.group(1) + matcher.group(2) + } + + return version +} \ No newline at end of file diff --git a/src/reference/antora/antora-playbook.yml b/src/reference/antora/antora-playbook.yml index 8397e13ecc..1b86b09228 100644 --- a/src/reference/antora/antora-playbook.yml +++ b/src/reference/antora/antora-playbook.yml @@ -23,6 +23,7 @@ asciidoc: extensions: - '@asciidoctor/tabs' - '@springio/asciidoctor-extensions' + - '@springio/asciidoctor-extensions/javadoc-extension' sourcemap: true urls: latest_version_segment: '' diff --git a/src/reference/antora/antora.yml b/src/reference/antora/antora.yml index a3fb163dea..9d76b428bb 100644 --- a/src/reference/antora/antora.yml +++ b/src/reference/antora/antora.yml @@ -15,16 +15,7 @@ asciidoc: attributes: attribute-missing: 'warn' chomp: 'all' - spring-docs: 'https://docs.spring.io' - spring-framework-docs: '{spring-docs}/spring-framework/reference' - spring-integration-docs: '{spring-docs}/spring-integration/reference' - spring-amqp-java-docs: '{spring-docs}/spring-amqp/docs/current/api/org/springframework/amqp' - spring-framework-java-docs: '{spring-docs}/spring/docs/current/javadoc-api/org/springframework' - spring-retry-java-docs: '{spring-docs}/spring-retry/docs/api/current/' # External projects URLs and related attributes - micrometer-docs: 'https://docs.micrometer.io' - micrometer-tracing-docs: '{micrometer-docs}/tracing/reference/' - micrometer-micrometer-docs: '{micrometer-docs}/micrometer/reference/' rabbitmq-stream-docs: 'https://rabbitmq.github.io/rabbitmq-stream-java-client/stable/htmlsingle' rabbitmq-github: 'https://github.com/rabbitmq' rabbitmq-server-github: '{rabbitmq-github}/rabbitmq-server/tree/main/deps' \ No newline at end of file diff --git a/src/reference/antora/modules/ROOT/pages/amqp/broker-configuration.adoc b/src/reference/antora/modules/ROOT/pages/amqp/broker-configuration.adoc index 25fcc78241..39dfa15ce5 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/broker-configuration.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/broker-configuration.adoc @@ -359,7 +359,7 @@ public Exchange exchange() { } ---- -See the Javadoc for {spring-amqp-java-docs}/core/QueueBuilder.html[`org.springframework.amqp.core.QueueBuilder`] and {spring-amqp-java-docs}/core/ExchangeBuilder.html[`org.springframework.amqp.core.ExchangeBuilder`] for more information. +See the Javadoc for javadoc:org.springframework.amqp.core.QueueBuilder[`org.springframework.amqp.core.QueueBuilder`] and javadoc:org.springframework.amqp.core.ExchangeBuilder[`org.springframework.amqp.core.ExchangeBuilder`] for more information. Starting with version 2.0, the `ExchangeBuilder` now creates durable exchanges by default, to be consistent with the simple constructors on the individual `AbstractExchange` classes. To make a non-durable exchange with the builder, use `.durable(false)` before invoking `.build()`. diff --git a/src/reference/antora/modules/ROOT/pages/amqp/connections.adoc b/src/reference/antora/modules/ROOT/pages/amqp/connections.adoc index c1b278a820..f85b670af9 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/connections.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/connections.adoc @@ -483,7 +483,7 @@ public class MyService { ---- It is important to unbind the resource after use. -For more information, see the {spring-amqp-java-docs}/rabbit/connection/AbstractRoutingConnectionFactory.html[JavaDoc] for `AbstractRoutingConnectionFactory`. +For more information, see the javadoc:org.springframework.amqp.rabbit.connection.AbstractRoutingConnectionFactory[JavaDoc] for `AbstractRoutingConnectionFactory`. Starting with version 1.4, `RabbitTemplate` supports the SpEL `sendConnectionFactorySelectorExpression` and `receiveConnectionFactorySelectorExpression` properties, which are evaluated on each AMQP protocol interaction operation (`send`, `sendAndReceive`, `receive`, or `receiveAndReply`), resolving to a `lookupKey` value for the provided `AbstractRoutingConnectionFactory`. You can use bean references, such as `@vHostResolver.getVHost(#root)` in the expression. diff --git a/src/reference/antora/modules/ROOT/pages/amqp/listener-queues.adoc b/src/reference/antora/modules/ROOT/pages/amqp/listener-queues.adoc index ed6101ec5c..c9972b3688 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/listener-queues.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/listener-queues.adoc @@ -8,7 +8,7 @@ Container can be initially configured to listen on zero queues. Queues can be added and removed at runtime. The `SimpleMessageListenerContainer` recycles (cancels and re-creates) all consumers when any pre-fetched messages have been processed. The `DirectMessageListenerContainer` creates/cancels individual consumer(s) for each queue without affecting consumers on other queues. -See the {spring-amqp-java-docs}/rabbit/listener/AbstractMessageListenerContainer.html[Javadoc] for the `addQueues`, `addQueueNames`, `removeQueues` and `removeQueueNames` methods. +See the javadoc:org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer[Javadoc] for the `addQueues`, `addQueueNames`, `removeQueues` and `removeQueueNames` methods. If not all queues are available, the container tries to passively declare (and consume from) the missing queues every 60 seconds. diff --git a/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/async-annotation-driven/enable.adoc b/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/async-annotation-driven/enable.adoc index 422de556ef..c9d37e7a09 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/async-annotation-driven/enable.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/async-annotation-driven/enable.adoc @@ -37,7 +37,7 @@ In this case, and ignoring the RabbitMQ infrastructure setup, the `processOrder` You can customize the listener container factory to use for each annotation, or you can configure an explicit default by implementing the `RabbitListenerConfigurer` interface. The default is required only if at least one endpoint is registered without a specific container factory. -See the {spring-amqp-java-docs}/rabbit/annotation/RabbitListenerConfigurer.html[Javadoc] for full details and examples. +See the javadoc:org.springframework.amqp.rabbit.annotation.RabbitListenerConfigurer[Javadoc] for full details and examples. The container factories provide methods for adding `MessagePostProcessor` instances that are applied after receiving messages (before invoking the listener) and before sending replies. diff --git a/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/micrometer.adoc b/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/micrometer.adoc index bc581083ad..8ccb1548eb 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/micrometer.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/micrometer.adoc @@ -2,7 +2,7 @@ = Micrometer Integration :page-section-summary-toc: 1 -NOTE: This section documents the integration with {micrometer-micrometer-docs}[Micrometer]. +NOTE: This section documents the integration with {micrometer-docs}[Micrometer]. For integration with Micrometer Observation, see xref:amqp/receiving-messages/micrometer-observation.adoc[Micrometer Observation]. Starting with version 2.2, the listener containers will automatically create and update Micrometer `Timer` s for the listener, if `Micrometer` is detected on the class path, and a single `MeterRegistry` is present in the application context (or exactly one is annotated `@Primary`, such as when using Spring Boot). diff --git a/src/reference/antora/modules/ROOT/pages/amqp/request-reply.adoc b/src/reference/antora/modules/ROOT/pages/amqp/request-reply.adoc index 3689437cb3..e3a8634e95 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/request-reply.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/request-reply.adoc @@ -6,11 +6,11 @@ Those methods are quite useful for request-reply scenarios, since they handle th Similar request-reply methods are also available where the `MessageConverter` is applied to both the request and reply. Those methods are named `convertSendAndReceive`. -See the {spring-amqp-java-docs}/core/AmqpTemplate.html[Javadoc of `AmqpTemplate`] for more detail. +See the javadoc:org.springframework.amqp.core.AmqpTemplate[Javadoc of `AmqpTemplate`] for more detail. Starting with version 1.5.0, each of the `sendAndReceive` method variants has an overloaded version that takes `CorrelationData`. Together with a properly configured connection factory, this enables the receipt of publisher confirms for the send side of the operation. -See xref:amqp/template.adoc#template-confirms[Correlated Publisher Confirms and Returns] and the {spring-amqp-java-docs}/rabbit/core/RabbitOperations.html[Javadoc for `RabbitOperations`] for more information. +See xref:amqp/template.adoc#template-confirms[Correlated Publisher Confirms and Returns] and the javadoc:org.springframework.amqp.rabbit.core.RabbitOperations[Javadoc for `RabbitOperations`] for more information. Starting with version 2.0, there are variants of these methods (`convertSendAndReceiveAsType`) that take an additional `ParameterizedTypeReference` argument to convert complex returned types. The template must be configured with a `SmartMessageConverter`. diff --git a/src/reference/antora/modules/ROOT/pages/amqp/sending-messages.adoc b/src/reference/antora/modules/ROOT/pages/amqp/sending-messages.adoc index 6ff5f1257d..eff9bd900f 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/sending-messages.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/sending-messages.adoc @@ -100,7 +100,7 @@ Message message = MessageBuilder.withBody("foo".getBytes()) .build(); ---- -Each of the properties defined on the {spring-amqp-java-docs}/core/MessageProperties.html[`MessageProperties`] can be set. +Each of the properties defined on the javadoc:org.springframework.amqp.core.MessageProperties[] can be set. Other methods include `setHeader(String key, String value)`, `removeHeader(String key)`, `removeHeaders()`, and `copyProperties(MessageProperties properties)`. Each property setting method has a `set*IfAbsent()` variant. In the cases where a default initial value exists, the method is named `set*IfAbsentOrDefault()`. diff --git a/src/reference/antora/modules/ROOT/pages/amqp/transactions.adoc b/src/reference/antora/modules/ROOT/pages/amqp/transactions.adoc index 59bb842f7b..796be4f4db 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/transactions.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/transactions.adoc @@ -116,13 +116,13 @@ See xref:amqp/containerAttributes.adoc[Message Listener Container Configuration] [[using-rabbittransactionmanager]] == Using `RabbitTransactionManager` -The {spring-amqp-java-docs}/rabbit/transaction/RabbitTransactionManager.html[RabbitTransactionManager] is an alternative to executing Rabbit operations within, and synchronized with, external transactions. -This transaction manager is an implementation of the {spring-framework-java-docs}/transaction/PlatformTransactionManager.html[`PlatformTransactionManager`] interface and should be used with a single Rabbit `ConnectionFactory`. +The javadoc:org.springframework.amqp.rabbit.transaction.RabbitTransactionManager[] is an alternative to executing Rabbit operations within, and synchronized with, external transactions. +This transaction manager is an implementation of the javadoc:org.springframework.transaction.PlatformTransactionManager[] interface and should be used with a single Rabbit `ConnectionFactory`. IMPORTANT: This strategy is not able to provide XA transactions -- for example, in order to share transactions between messaging and database access. Application code is required to retrieve the transactional Rabbit resources through `ConnectionFactoryUtils.getTransactionalResourceHolder(ConnectionFactory, boolean)` instead of a standard `Connection.createChannel()` call with subsequent channel creation. -When using Spring AMQP's {spring-amqp-java-docs}/rabbit/core/RabbitTemplate.html[RabbitTemplate], it will autodetect a thread-bound Channel and automatically participate in its transaction. +When using Spring AMQP's javadoc:org.springframework.amqp.rabbit.core.RabbitTemplate[], it will autodetect a thread-bound Channel and automatically participate in its transaction. With Java Configuration, you can setup a new RabbitTransactionManager by using the following bean: diff --git a/src/reference/antora/modules/ROOT/pages/sample-apps.adoc b/src/reference/antora/modules/ROOT/pages/sample-apps.adoc index 90a2775e53..842c5c72a2 100644 --- a/src/reference/antora/modules/ROOT/pages/sample-apps.adoc +++ b/src/reference/antora/modules/ROOT/pages/sample-apps.adoc @@ -351,4 +351,4 @@ Spring applications, when sending JSON, set the `__TypeId__` header to the fully The `spring-rabbit-json` sample explores several techniques to convert the JSON from a non-Spring application. -See also xref:amqp/message-converters.adoc#json-message-converter[`Jackson2JsonMessageConverter`] as well as the {spring-amqp-java-docs}/index.html?org/springframework/amqp/support/converter/DefaultClassMapper.html[Javadoc for the `DefaultClassMapper`]. +See also xref:amqp/message-converters.adoc#json-message-converter[`Jackson2JsonMessageConverter`] as well as the javadoc:org.springframework.amqp.support.converter.DefaultClassMapper[Javadoc for the `DefaultClassMapper`]. From 69fb20890790441be66e95c679064272af35326b Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Sun, 16 Feb 2025 10:53:04 +0700 Subject: [PATCH 2/5] Polish Signed-off-by: Tran Ngoc Nhan --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index fa32f31b8f..6a4102a364 100644 --- a/build.gradle +++ b/build.gradle @@ -731,9 +731,9 @@ def generateAttributes() { return [ 'project-version': project.version, + 'spring-integration-docs': "$springDocs/spring-integration/reference".toString(), 'spring-framework-docs': "$springDocs/spring-framework/reference/%s".formatted(generateVersionWithoutPatch(springVersion)), 'spring-retry-java-docs': "$springDocs/spring-retry/docs/$springRetryVersion/apidocs".toString(), - 'spring-integration-docs': "$springDocs/spring-integration/reference".toString(), 'javadoc-location-org-springframework-transaction': "$springDocs/spring-framework/docs/$springVersion/javadoc-api".toString(), 'javadoc-location-org-springframework-amqp': "$springDocs/spring-amqp/docs/$project.version/api".toString(), 'micrometer-docs': "$micrometerDocsPrefix/micrometer/reference/%s".formatted(generateVersionWithoutPatch(micrometerVersion)), From f7cbc9810222ab8dcb394a00136fd31bfc1ef543 Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Tue, 18 Feb 2025 23:34:34 +0700 Subject: [PATCH 3/5] Use pattern matching Signed-off-by: Tran Ngoc Nhan --- build.gradle | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 6a4102a364..878b0be792 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,3 @@ -import java.util.regex.Pattern - buildscript { ext.kotlinVersion = '2.1.10' ext.isCI = System.getenv('GITHUB_ACTION') @@ -732,24 +730,24 @@ def generateAttributes() { return [ 'project-version': project.version, 'spring-integration-docs': "$springDocs/spring-integration/reference".toString(), - 'spring-framework-docs': "$springDocs/spring-framework/reference/%s".formatted(generateVersionWithoutPatch(springVersion)), + 'spring-framework-docs': "$springDocs/spring-framework/reference/${generateVersionWithoutPatch(springVersion)}".toString(), 'spring-retry-java-docs': "$springDocs/spring-retry/docs/$springRetryVersion/apidocs".toString(), 'javadoc-location-org-springframework-transaction': "$springDocs/spring-framework/docs/$springVersion/javadoc-api".toString(), 'javadoc-location-org-springframework-amqp': "$springDocs/spring-amqp/docs/$project.version/api".toString(), - 'micrometer-docs': "$micrometerDocsPrefix/micrometer/reference/%s".formatted(generateVersionWithoutPatch(micrometerVersion)), - 'micrometer-tracing-docs': "$micrometerDocsPrefix/tracing/reference/%s".formatted(generateVersionWithoutPatch(micrometerTracingVersion)) + 'micrometer-docs': "$micrometerDocsPrefix/micrometer/reference/${generateVersionWithoutPatch(micrometerVersion)}".toString(), + 'micrometer-tracing-docs': "$micrometerDocsPrefix/tracing/reference/${generateVersionWithoutPatch(micrometerTracingVersion)}".toString() ] } static String generateVersionWithoutPatch(String version) { - def matcher = Pattern.compile("^(\\d+.\\d+).\\d+(-SNAPSHOT)?\$").matcher(version); - if(matcher.find()) { + def matcher = version =~ /^(\d+.\d+).\d+(-SNAPSHOT)?$/ + if(matcher) { - return matcher.group(2) == null - ? matcher.group(1) - : matcher.group(1) + matcher.group(2) + return matcher[0][2] == null + ? matcher[0][1] + : matcher[0][1] + matcher[0][2] } return version -} \ No newline at end of file +} From 9f897be262143bf638e05d00739b420b8fdd76c9 Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Fri, 21 Feb 2025 15:57:49 +0700 Subject: [PATCH 4/5] Update version for milestone Signed-off-by: Tran Ngoc Nhan --- build.gradle | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 878b0be792..7e254707ad 100644 --- a/build.gradle +++ b/build.gradle @@ -728,23 +728,23 @@ def generateAttributes() { def micrometerDocsPrefix = "https://docs.micrometer.io" return [ - 'project-version': project.version, - 'spring-integration-docs': "$springDocs/spring-integration/reference".toString(), - 'spring-framework-docs': "$springDocs/spring-framework/reference/${generateVersionWithoutPatch(springVersion)}".toString(), - 'spring-retry-java-docs': "$springDocs/spring-retry/docs/$springRetryVersion/apidocs".toString(), - 'javadoc-location-org-springframework-transaction': "$springDocs/spring-framework/docs/$springVersion/javadoc-api".toString(), - 'javadoc-location-org-springframework-amqp': "$springDocs/spring-amqp/docs/$project.version/api".toString(), - 'micrometer-docs': "$micrometerDocsPrefix/micrometer/reference/${generateVersionWithoutPatch(micrometerVersion)}".toString(), - 'micrometer-tracing-docs': "$micrometerDocsPrefix/tracing/reference/${generateVersionWithoutPatch(micrometerTracingVersion)}".toString() + "project-version": project.version, + "spring-integration-docs": "$springDocs/spring-integration/reference".toString(), + "spring-framework-docs": "$springDocs/spring-framework/reference/${generateVersionWithoutPatch(springVersion)}".toString(), + "spring-retry-java-docs": "$springDocs/spring-retry/docs/$springRetryVersion/apidocs".toString(), + "javadoc-location-org-springframework-transaction": "$springDocs/spring-framework/docs/$springVersion/javadoc-api".toString(), + "javadoc-location-org-springframework-amqp": "$springDocs/spring-amqp/docs/$project.version/api".toString(), + "micrometer-docs": "$micrometerDocsPrefix/micrometer/reference/${generateVersionWithoutPatch(micrometerVersion)}".toString(), + "micrometer-tracing-docs": "$micrometerDocsPrefix/tracing/reference/${generateVersionWithoutPatch(micrometerTracingVersion)}".toString() ] } static String generateVersionWithoutPatch(String version) { - def matcher = version =~ /^(\d+.\d+).\d+(-SNAPSHOT)?$/ + def matcher = version =~ /^(\d+.\d+).\d+(-SNAPSHOT|-M\d+)?$/ if(matcher) { - return matcher[0][2] == null + return matcher[0][2] == null || matcher[0][2].startsWith("-M") ? matcher[0][1] : matcher[0][1] + matcher[0][2] } From b9d940d71b6c26bbeceafa4227d2f012d07ed55e Mon Sep 17 00:00:00 2001 From: Tran Ngoc Nhan Date: Fri, 21 Feb 2025 23:39:32 +0700 Subject: [PATCH 5/5] Polish antora file and simplify version method Signed-off-by: Tran Ngoc Nhan --- build.gradle | 26 +++++++++----------------- src/reference/antora/antora.yml | 2 +- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/build.gradle b/build.gradle index 7e254707ad..2f86691323 100644 --- a/build.gradle +++ b/build.gradle @@ -728,26 +728,18 @@ def generateAttributes() { def micrometerDocsPrefix = "https://docs.micrometer.io" return [ - "project-version": project.version, - "spring-integration-docs": "$springDocs/spring-integration/reference".toString(), - "spring-framework-docs": "$springDocs/spring-framework/reference/${generateVersionWithoutPatch(springVersion)}".toString(), - "spring-retry-java-docs": "$springDocs/spring-retry/docs/$springRetryVersion/apidocs".toString(), - "javadoc-location-org-springframework-transaction": "$springDocs/spring-framework/docs/$springVersion/javadoc-api".toString(), - "javadoc-location-org-springframework-amqp": "$springDocs/spring-amqp/docs/$project.version/api".toString(), - "micrometer-docs": "$micrometerDocsPrefix/micrometer/reference/${generateVersionWithoutPatch(micrometerVersion)}".toString(), - "micrometer-tracing-docs": "$micrometerDocsPrefix/tracing/reference/${generateVersionWithoutPatch(micrometerTracingVersion)}".toString() + 'project-version': project.version, + 'spring-integration-docs': "$springDocs/spring-integration/reference".toString(), + 'spring-framework-docs': "$springDocs/spring-framework/reference/${generateVersionWithoutPatch(springVersion)}".toString(), + 'spring-retry-java-docs': "$springDocs/spring-retry/docs/$springRetryVersion/apidocs".toString(), + 'javadoc-location-org-springframework-transaction': "$springDocs/spring-framework/docs/$springVersion/javadoc-api".toString(), + 'javadoc-location-org-springframework-amqp': "$springDocs/spring-amqp/docs/$project.version/api".toString(), + 'micrometer-docs': "$micrometerDocsPrefix/micrometer/reference/${generateVersionWithoutPatch(micrometerVersion)}".toString(), + 'micrometer-tracing-docs': "$micrometerDocsPrefix/tracing/reference/${generateVersionWithoutPatch(micrometerTracingVersion)}".toString() ] } static String generateVersionWithoutPatch(String version) { - def matcher = version =~ /^(\d+.\d+).\d+(-SNAPSHOT|-M\d+)?$/ - if(matcher) { - - return matcher[0][2] == null || matcher[0][2].startsWith("-M") - ? matcher[0][1] - : matcher[0][1] + matcher[0][2] - } - - return version + return version.split('\\.')[0,1].join('.') + (version.endsWith('-SNAPSHOT') ? '-SNAPSHOT' : '') } diff --git a/src/reference/antora/antora.yml b/src/reference/antora/antora.yml index 9d76b428bb..b12a23a465 100644 --- a/src/reference/antora/antora.yml +++ b/src/reference/antora/antora.yml @@ -18,4 +18,4 @@ asciidoc: # External projects URLs and related attributes rabbitmq-stream-docs: 'https://rabbitmq.github.io/rabbitmq-stream-java-client/stable/htmlsingle' rabbitmq-github: 'https://github.com/rabbitmq' - rabbitmq-server-github: '{rabbitmq-github}/rabbitmq-server/tree/main/deps' \ No newline at end of file + rabbitmq-server-github: '{rabbitmq-github}/rabbitmq-server/tree/main/deps'