Skip to content

Commit

Permalink
Compile-time weaving requires aspectjrt, not aspectjweaver
Browse files Browse the repository at this point in the history
Aspect-enhanced classes need aspectjrt on the class path. If it is not,
the AspectJ Compiler usually complains, either warning or even
failing the build, also via AspectJ Maven. The aspectjweaver, however,
is for load-time weaving. It is a superset of aspectjrt, but bigger than
necessary. Also, the weaver was only test-scoped, but also during normal
runtime aspectjrt is necessary. Without it, it can only work by the
lucky chance that Spring already depends on aspectjweaver, which is not
good dependency management. Each Maven module should be self-consistent.

Aspectjrt was a plugin dependency for AJ Maven, which is also
superfluous, because aspectjtools already is a superset of
aspectjweaver, i.e. it also contains aspectjrt. Hence, aspectjtools is
all AJ Maven needs, but the compiled application is who really
needs aspectjrt.
  • Loading branch information
kriegaex committed Dec 21, 2023
1 parent b3312de commit d11fde0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions spring-data-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@

<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj}</version>
<scope>test</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -362,11 +361,6 @@
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.14.0</version>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
Expand Down

0 comments on commit d11fde0

Please sign in to comment.