From 1631be5660fa61faa88264aa253e4fef32f55b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Wed, 10 Jan 2024 17:07:55 +0100 Subject: [PATCH] Provide guidelines in AspectJ documentation to avoid dumps Closes gh-27650 --- .../ROOT/pages/core/aop/using-aspectj.adoc | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/framework-docs/modules/ROOT/pages/core/aop/using-aspectj.adoc b/framework-docs/modules/ROOT/pages/core/aop/using-aspectj.adoc index 8694443677..f6434227c3 100644 --- a/framework-docs/modules/ROOT/pages/core/aop/using-aspectj.adoc +++ b/framework-docs/modules/ROOT/pages/core/aop/using-aspectj.adoc @@ -533,6 +533,11 @@ standard AspectJ. The following example shows the `aop.xml` file: ---- +NOTE: It is recommended to only weave specific classes (typically those in the +application packages, as shown in the `aop.xml` example above) in order +to avoid side effects such as AspectJ dump files and warnings. +This is also a best practice from an efficiency perspective. + Now we can move on to the Spring-specific portion of the configuration. We need to configure a `LoadTimeWeaver` (explained later). This load-time weaver is the essential component responsible for weaving the aspect configuration in one or @@ -714,10 +719,29 @@ Furthermore, the compiled aspect classes need to be available on the classpath. [[aop-aj-ltw-aop_dot_xml]] -=== 'META-INF/aop.xml' +=== `META-INF/aop.xml` The AspectJ LTW infrastructure is configured by using one or more `META-INF/aop.xml` files that are on the Java classpath (either directly or, more typically, in jar files). +For example: + +[source,xml,indent=0,subs="verbatim"] +---- + + + + + + + + + +---- + +NOTE: It is recommended to only weave specific classes (typically those in the +application packages, as shown in the `aop.xml` example above) in order +to avoid side effects such as AspectJ dump files and warnings. +This is also a best practice from an efficiency perspective. The structure and contents of this file is detailed in the LTW part of the {aspectj-docs-devguide}/ltw-configuration.html[AspectJ reference