Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract recurring asciidoc links to attributes #31619

Merged
merged 8 commits into from
Nov 21, 2023
76 changes: 67 additions & 9 deletions framework-docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,73 @@ asciidoc:
# FIXME: The package is not renamed
chomp: 'all'
simonbasle marked this conversation as resolved.
Show resolved Hide resolved
include-java: 'example$docs-src/main/java/org/springframework/docs'
spring-framework-main-code: 'https://github.com/spring-projects/spring-framework/tree/main'
spring-site: 'https://spring.io'
spring-site-blog: '{spring-site}/blog'
spring-site-cve: "{spring-site}/security"
spring-site-guides: '{spring-site}/guides'
spring-site-projects: '{spring-site}/projects'
spring-site-tools: "{spring-site}/tools"
spring-org: 'spring-projects'
spring-repo: "{spring-org}/spring-framework"
sbrannen marked this conversation as resolved.
Show resolved Hide resolved
spring-github-org: "https://github.com/{spring-org}"
spring-framework-github: "https://github.com/{spring-repo}"
spring-framework-code: '{spring-framework-github}/tree/main'
spring-framework-issues: '{spring-framework-github}/issues'
issues-old: 'https://jira.spring.io/browse'
sbrannen marked this conversation as resolved.
Show resolved Hide resolved
spring-framework-wiki: '{spring-framework-github}/wiki'
# Docs
docs-site: 'https://docs.spring.io'
docs-spring: "{docs-site}/spring-framework/docs/{spring-version}"
docs-spring-framework: '{docs-site}/spring-framework/docs/{spring-version}'
api-spring-framework: '{docs-spring-framework}/javadoc-api/org/springframework'
docs-graalvm: 'https://www.graalvm.org/22.3/reference-manual'
docs-spring-boot: '{docs-site}/spring-boot/docs/current/reference'
spring-framework-docs-root: '{docs-site}/spring-framework/docs'
spring-framework-api: '{spring-framework-docs-root}/{spring-version}/javadoc-api/org/springframework'
spring-framework-api-kdoc: '{spring-framework-docs-root}/{spring-version}/kdoc-api'
spring-framework-reference: '{spring-framework-docs-root}/{spring-version}/reference'
#
# Other Spring portfolio projects
spring-boot-docs: '{docs-site}/spring-boot/docs/current/reference/html'
spring-boot-issues: '{spring-github-org}/spring-boot/issues'
# TODO add more projects / links or just build up on {docs-site}?
# TODO rename the below using new conventions
docs-spring-gemfire: '{docs-site}/spring-gemfire/docs/current/reference'
docs-spring-security: '{docs-site}/spring-security/reference'
gh-rsocket: 'https://github.com/rsocket'
gh-rsocket-extensions: '{gh-rsocket}/rsocket/blob/master/Extensions'
gh-rsocket-java: '{gh-rsocket}/rsocket-java{gh-rsocket}/rsocket-java'
docs-spring-session: '{docs-site}/spring-session/reference'
#
# External projects URLs and related attributes
aspectj-site: 'https://www.eclipse.org/aspectj'
aspectj-docs: "{aspectj-site}/doc/released"
aspectj-api: "{aspectj-docs}/runtime-api"
aspectj-docs-devguide: "{aspectj-docs}/devguide"
aspectj-docs-progguide: "{aspectj-docs}/progguide"
assertj-docs: 'https://assertj.github.io/doc'
baeldung-blog: 'https://www.baeldung.com'
bean-validation-site: 'https://beanvalidation.org'
graalvm-docs: 'https://www.graalvm.org/22.3/reference-manual'
hibernate-validator-site: 'https://hibernate.org/validator/'
jackson-docs: 'https://fasterxml.github.io'
jackson-github-org: 'https://github.com/FasterXML'
java-api: 'https://docs.oracle.com/en/java/javase/17/docs/api'
java-tutorial: 'https://docs.oracle.com/javase/tutorial'
JSR: 'https://www.jcp.org/en/jsr/detail?id='
kotlin-site: 'https://kotlinlang.org'
kotlin-docs: '{kotlin-site}/docs'
kotlin-api: '{kotlin-site}/api/latest'
kotlin-coroutines-api: '{kotlin-site}/api/kotlinx.coroutines'
kotlin-github-org: 'https://github.com/Kotlin'
kotlin-issues: 'https://youtrack.jetbrains.com/issue'
reactive-streams-site: 'https://www.reactive-streams.org'
reactive-streams-spec: 'https://github.com/reactive-streams/reactive-streams-jvm/blob/master/README.md#specification'
reactor-github-org: 'https://github.com/reactor'
reactor-site: 'https://projectreactor.io'
rsocket-github-org: 'https://github.com/rsocket'
rsocket-java: '{rsocket-github-org}/rsocket-java'
rsocket-java-code: '{rsocket-java}/tree/master/'
rsocket-protocol-extensions: '{rsocket-github-org}/rsocket/tree/master/Extensions'
rsocket-site: 'https://rsocket.io'
rfc-site: 'https://datatracker.ietf.org/doc/html'
sockjs-client: 'https://github.com/sockjs/sockjs-client'
sockjs-protocol: 'https://github.com/sockjs/sockjs-protocol'
sockjs-protocol-site: "https://sockjs.github.io/sockjs-protocol"
stackoverflow-site: 'https://stackoverflow.com'
stackoverflow-questions: '{stackoverflow-site}/questions'
stackoverflow-spring-tag: "{stackoverflow-questions}/tagged/spring"
stackoverflow-spring-kotlin-tags: "{stackoverflow-spring-tag}+kotlin"
testcontainers-site: 'https://www.testcontainers.org'
2 changes: 1 addition & 1 deletion framework-docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -438,4 +438,4 @@
** xref:languages/groovy.adoc[]
** xref:languages/dynamic.adoc[]
* xref:appendix.adoc[]
* https://github.com/spring-projects/spring-framework/wiki[Wiki]
* {spring-framework-wiki}[Wiki]
10 changes: 5 additions & 5 deletions framework-docs/modules/ROOT/pages/appendix.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ within the core Spring Framework.
[[appendix-spring-properties]]
== Spring Properties

{api-spring-framework}/core/SpringProperties.html[`SpringProperties`] is a static holder
{spring-framework-api}/core/SpringProperties.html[`SpringProperties`] is a static holder
for properties that control certain low-level aspects of the Spring Framework. Users can
configure these properties via JVM system properties or programmatically via the
`SpringProperties.setProperty(String key, String value)` method. The latter may be
Expand All @@ -25,7 +25,7 @@ The following table lists all currently supported Spring properties.
| `spring.beaninfo.ignore`
| Instructs Spring to use the `Introspector.IGNORE_ALL_BEANINFO` mode when calling the
JavaBeans `Introspector`. See
{api-spring-framework}++/beans/StandardBeanInfoFactory.html#IGNORE_BEANINFO_PROPERTY_NAME++[`CachedIntrospectionResults`]
{spring-framework-api}++/beans/StandardBeanInfoFactory.html#IGNORE_BEANINFO_PROPERTY_NAME++[`CachedIntrospectionResults`]
for details.

| `spring.expression.compiler.mode`
Expand All @@ -36,7 +36,7 @@ xref:core/expressions/evaluation.adoc#expressions-compiler-configuration[Spring
| Instructs Spring to ignore operating system environment variables if a Spring
`Environment` property -- for example, a placeholder in a configuration String -- isn't
resolvable otherwise. See
{api-spring-framework}++/core/env/AbstractEnvironment.html#IGNORE_GETENV_PROPERTY_NAME++[`AbstractEnvironment`]
{spring-framework-api}++/core/env/AbstractEnvironment.html#IGNORE_GETENV_PROPERTY_NAME++[`AbstractEnvironment`]
for details.

| `spring.jdbc.getParameterType.ignore`
Expand All @@ -47,12 +47,12 @@ See the note in xref:data-access/jdbc/advanced.adoc#jdbc-batch-list[Batch Operat
| Instructs Spring to ignore a default JNDI environment, as an optimization for scenarios
where nothing is ever to be found for such JNDI fallback searches to begin with, avoiding
the repeated JNDI lookup overhead. See
{api-spring-framework}++/jndi/JndiLocatorDelegate.html#IGNORE_JNDI_PROPERTY_NAME++[`JndiLocatorDelegate`]
{spring-framework-api}++/jndi/JndiLocatorDelegate.html#IGNORE_JNDI_PROPERTY_NAME++[`JndiLocatorDelegate`]
for details.

| `spring.objenesis.ignore`
| Instructs Spring to ignore Objenesis, not even attempting to use it. See
{api-spring-framework}++/objenesis/SpringObjenesis.html#IGNORE_OBJENESIS_PROPERTY_NAME++[`SpringObjenesis`]
{spring-framework-api}++/objenesis/SpringObjenesis.html#IGNORE_OBJENESIS_PROPERTY_NAME++[`SpringObjenesis`]
for details.

| `spring.test.aot.processing.failOnError`
Expand Down
30 changes: 15 additions & 15 deletions framework-docs/modules/ROOT/pages/attributes.adoc
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
// Spring Portfolio
:docs-site: https://docs.spring.io
:docs-spring-boot: {docs-site}/spring-boot/docs/current/reference
:docs-spring-gemfire: {docs-site}/spring-gemfire/docs/current/reference
:docs-spring-security: {docs-site}/spring-security/reference
// :docs-site: https://docs.spring.io
simonbasle marked this conversation as resolved.
Show resolved Hide resolved
// :docs-spring-boot: {docs-site}/spring-boot/docs/current/reference
// :docs-spring-gemfire: {docs-site}/spring-gemfire/docs/current/reference
// :docs-spring-security: {docs-site}/spring-security/reference
// spring-asciidoctor-backends Settings
:chomp: default headers packages
:fold: all
// Spring Framework
:docs-spring-framework: {docs-site}/spring-framework/docs/{spring-version}
:api-spring-framework: {docs-spring-framework}/javadoc-api/org/springframework
:docs-java: {docdir}/../../main/java/org/springframework/docs
:docs-kotlin: {docdir}/../../main/kotlin/org/springframework/docs
:docs-resources: {docdir}/../../main/resources
:spring-framework-main-code: https://github.com/spring-projects/spring-framework/tree/main
// Third-party Links
:docs-graalvm: https://www.graalvm.org/22.3/reference-manual
:gh-rsocket: https://github.com/rsocket
:gh-rsocket-extensions: {gh-rsocket}/rsocket/blob/master/Extensions
:gh-rsocket-java: {gh-rsocket}/rsocket-java
// :docs-spring-framework: {docs-site}/spring-framework/docs/{spring-version}
// :api-spring-framework: {docs-spring-framework}/javadoc-api/org/springframework
// :docs-java: {docdir}/../../main/java/org/springframework/docs
// :docs-kotlin: {docdir}/../../main/kotlin/org/springframework/docs
// :docs-resources: {docdir}/../../main/resources
// :spring-framework-main-code: {spring-framework}/tree/main
// // Third-party Links
// :docs-graalvm: https://www.graalvm.org/22.3/reference-manual
// :gh-rsocket: https://github.com/rsocket
// :gh-rsocket-extensions: {gh-rsocket}/rsocket/blob/master/Extensions
// :gh-rsocket-java: {gh-rsocket}/rsocket-java
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ support for new custom advice types be added without changing the core framework
The only constraint on a custom `Advice` type is that it must implement the
`org.aopalliance.aop.Advice` marker interface.

See the {api-spring-framework}/aop/framework/adapter/package-summary.html[`org.springframework.aop.framework.adapter`]
See the {spring-framework-api}/aop/framework/adapter/package-summary.html[`org.springframework.aop.framework.adapter`]
javadoc for further information.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ The following listing shows an example configuration:

Note that the target object (`businessObjectTarget` in the preceding example) must be a
prototype. This lets the `PoolingTargetSource` implementation create new instances
of the target to grow the pool as necessary. See the {api-spring-framework}/aop/target/AbstractPoolingTargetSource.html[javadoc of
of the target to grow the pool as necessary. See the {spring-framework-api}/aop/target/AbstractPoolingTargetSource.html[javadoc of
`AbstractPoolingTargetSource`] and the concrete subclass you wish to use for information
about its properties. `maxSize` is the most basic and is always guaranteed to be present.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Kotlin::
----
======

See the {api-spring-framework}/aop/aspectj/annotation/AspectJProxyFactory.html[javadoc] for more information.
See the {spring-framework-api}/aop/aspectj/annotation/AspectJProxyFactory.html[javadoc] for more information.



Expand Down
2 changes: 1 addition & 1 deletion framework-docs/modules/ROOT/pages/core/aop/ataspectj.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

@AspectJ refers to a style of declaring aspects as regular Java classes annotated with
annotations. The @AspectJ style was introduced by the
https://www.eclipse.org/aspectj[AspectJ project] as part of the AspectJ 5 release. Spring
{aspectj-site}[AspectJ project] as part of the AspectJ 5 release. Spring
interprets the same annotations as AspectJ 5, using a library supplied by AspectJ
for pointcut parsing and matching. The AOP runtime is still pure Spring AOP, though, and
there is no dependency on the AspectJ compiler or weaver.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ The `JoinPoint` interface provides a number of useful methods:
* `getSignature()`: Returns a description of the method that is being advised.
* `toString()`: Prints a useful description of the method being advised.

See the https://www.eclipse.org/aspectj/doc/released/runtime-api/org/aspectj/lang/JoinPoint.html[javadoc] for more detail.
See the {aspectj-api}/org/aspectj/lang/JoinPoint.html[javadoc] for more detail.

[[aop-ataspectj-advice-params-passing]]
=== Passing Parameters to Advice
Expand Down Expand Up @@ -730,7 +730,7 @@ of determining parameter names, an exception will be thrown.
flag for `javac`. Recommended approach on Java 8+.
`AspectJAdviceParameterNameDiscoverer` :: Deduces parameter names from the pointcut
expression, `returning`, and `throwing` clauses. See the
{api-spring-framework}/aop/aspectj/AspectJAdviceParameterNameDiscoverer.html[javadoc]
{spring-framework-api}/aop/aspectj/AspectJAdviceParameterNameDiscoverer.html[javadoc]
for details on the algorithm used.

[[aop-ataspectj-advice-params-names-explicit]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Kotlin::

The pointcut expression that forms the value of the `@Pointcut` annotation is a regular
AspectJ pointcut expression. For a full discussion of AspectJ's pointcut language, see
the https://www.eclipse.org/aspectj/doc/released/progguide/index.html[AspectJ
the {aspectj-docs-progguide}/index.html[AspectJ
Programming Guide] (and, for extensions, the
https://www.eclipse.org/aspectj/doc/released/adk15notebook/index.html[AspectJ 5
{aspectj-docs}/adk15notebook/index.html[AspectJ 5
Developer's Notebook]) or one of the books on AspectJ (such as _Eclipse AspectJ_, by Colyer
et al., or _AspectJ in Action_, by Ramnivas Laddad).

Expand Down Expand Up @@ -392,7 +392,7 @@ method that takes no parameters, whereas `(..)` matches any number (zero or more
The `({asterisk})` pattern matches a method that takes one parameter of any type.
`(*,String)` matches a method that takes two parameters. The first can be of any type, while the
second must be a `String`. Consult the
https://www.eclipse.org/aspectj/doc/released/progguide/semantics-pointcuts.html[Language
{aspectj-docs-progguide}/semantics-pointcuts.html[Language
Semantics] section of the AspectJ Programming Guide for more information.

The following examples show some common pointcut expressions:
Expand Down
2 changes: 1 addition & 1 deletion framework-docs/modules/ROOT/pages/core/aop/resources.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
= Further Resources
:page-section-summary-toc: 1

More information on AspectJ can be found on the https://www.eclipse.org/aspectj[AspectJ website].
More information on AspectJ can be found on the {aspectj-site}[AspectJ website].

_Eclipse AspectJ_ by Adrian Colyer et. al. (Addison-Wesley, 2005) provides a
comprehensive introduction and reference for the AspectJ language.
Expand Down
17 changes: 8 additions & 9 deletions framework-docs/modules/ROOT/pages/core/aop/using-aspectj.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ using Spring in accordance with the properties of the annotation". In this conte
"initialization" refers to newly instantiated objects (for example, objects instantiated
with the `new` operator) as well as to `Serializable` objects that are undergoing
deserialization (for example, through
https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html[readResolve()]).
{java-api}/java.base/java/io/Serializable.html[readResolve()]).

[NOTE]
=====
Expand Down Expand Up @@ -168,14 +168,13 @@ Kotlin::

You can find more information about the language semantics of the various pointcut
types in AspectJ
https://www.eclipse.org/aspectj/doc/next/progguide/semantics-joinPoints.html[in this
appendix] of the https://www.eclipse.org/aspectj/doc/next/progguide/index.html[AspectJ
Programming Guide].
{aspectj-docs-progguide}/semantics-joinPoints.html[in this appendix] of the
{aspectj-docs-progguide}/index.html[AspectJ Programming Guide].
=====

For this to work, the annotated types must be woven with the AspectJ weaver. You can
either use a build-time Ant or Maven task to do this (see, for example, the
https://www.eclipse.org/aspectj/doc/released/devguide/antTasks.html[AspectJ Development
{aspectj-docs-devguide}/antTasks.html[AspectJ Development
Environment Guide]) or load-time weaving (see xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time Weaving with AspectJ in the Spring Framework]). The
`AnnotationBeanConfigurerAspect` itself needs to be configured by Spring (in order to obtain
a reference to the bean factory that is to be used to configure new objects). If you
Expand Down Expand Up @@ -399,7 +398,7 @@ The focus of this section is on configuring and using LTW in the specific contex
Spring Framework. This section is not a general introduction to LTW. For full details on
the specifics of LTW and configuring LTW with only AspectJ (with Spring not being
involved at all), see the
https://www.eclipse.org/aspectj/doc/released/devguide/ltw.html[LTW section of the AspectJ
{aspectj-docs-devguide}/ltw.html[LTW section of the AspectJ
Development Environment Guide].

The value that the Spring Framework brings to AspectJ LTW is in enabling much
Expand All @@ -421,7 +420,7 @@ who typically are in charge of the deployment configuration, such as the launch
Now that the sales pitch is over, let us first walk through a quick example of AspectJ
LTW that uses Spring, followed by detailed specifics about elements introduced in the
example. For a complete example, see the
https://github.com/spring-projects/spring-petclinic[Petclinic sample application].
{spring-github-org}/spring-petclinic[Petclinic sample application].


[[aop-aj-ltw-first-example]]
Expand Down Expand Up @@ -621,7 +620,7 @@ java -javaagent:C:/projects/xyz/lib/spring-instrument.jar com.xyz.Main
----

The `-javaagent` is a flag for specifying and enabling
https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/package-summary.html[agents
{java-api}/java.instrument/java/lang/instrument/package-summary.html[agents
to instrument programs that run on the JVM]. The Spring Framework ships with such an
agent, the `InstrumentationSavingAgent`, which is packaged in the
`spring-instrument.jar` that was supplied as the value of the `-javaagent` argument in
Expand Down Expand Up @@ -721,7 +720,7 @@ The AspectJ LTW infrastructure is configured by using one or more `META-INF/aop.
files that are on the Java classpath (either directly or, more typically, in jar files).

The structure and contents of this file is detailed in the LTW part of the
https://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html[AspectJ reference
{aspectj-docs-devguide}/ltw-configuration.html[AspectJ reference
documentation]. Because the `aop.xml` file is 100% AspectJ, we do not describe it further here.


Expand Down