@@ -533,6 +533,11 @@ standard AspectJ. The following example shows the `aop.xml` file:
533
533
</aspectj>
534
534
----
535
535
536
+ NOTE: It is recommended to only weave specific classes (typically those in the
537
+ application packages, as shown in the `aop.xml` example above) in order
538
+ to avoid side effects such as AspectJ dump files and warnings.
539
+ This is also a best practice from an efficiency perspective.
540
+
536
541
Now we can move on to the Spring-specific portion of the configuration. We need
537
542
to configure a `LoadTimeWeaver` (explained later). This load-time weaver is the
538
543
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.
714
719
715
720
716
721
[[aop-aj-ltw-aop_dot_xml]]
717
- === ' META-INF/aop.xml'
722
+ === ` META-INF/aop.xml`
718
723
719
724
The AspectJ LTW infrastructure is configured by using one or more `META-INF/aop.xml`
720
725
files that are on the Java classpath (either directly or, more typically, in jar files).
726
+ For example:
727
+
728
+ [source,xml,indent=0,subs="verbatim"]
729
+ ----
730
+ <!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN" "https://www.eclipse.org/aspectj/dtd/aspectj.dtd">
731
+ <aspectj>
732
+
733
+ <weaver>
734
+ <!-- only weave classes in our application-specific packages -->
735
+ <include within="com.xyz.*"/>
736
+ </weaver>
737
+
738
+ </aspectj>
739
+ ----
740
+
741
+ NOTE: It is recommended to only weave specific classes (typically those in the
742
+ application packages, as shown in the `aop.xml` example above) in order
743
+ to avoid side effects such as AspectJ dump files and warnings.
744
+ This is also a best practice from an efficiency perspective.
721
745
722
746
The structure and contents of this file is detailed in the LTW part of the
723
747
{aspectj-docs-devguide}/ltw-configuration.html[AspectJ reference
0 commit comments