Skip to content

Commit 7d7274a

Browse files
kriegaexmp911de
authored andcommitted
Compile-time weaving requires aspectjrt, not aspectjweaver.
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. See #3282
1 parent 5efcf33 commit 7d7274a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

spring-data-jpa/pom.xml

+1-7
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@
8181

8282
<dependency>
8383
<groupId>org.aspectj</groupId>
84-
<artifactId>aspectjweaver</artifactId>
84+
<artifactId>aspectjrt</artifactId>
8585
<version>${aspectj}</version>
86-
<scope>test</scope>
8786
</dependency>
8887

8988
<dependency>
@@ -362,11 +361,6 @@
362361
<artifactId>aspectj-maven-plugin</artifactId>
363362
<version>1.14.0</version>
364363
<dependencies>
365-
<dependency>
366-
<groupId>org.aspectj</groupId>
367-
<artifactId>aspectjrt</artifactId>
368-
<version>${aspectj}</version>
369-
</dependency>
370364
<dependency>
371365
<groupId>org.aspectj</groupId>
372366
<artifactId>aspectjtools</artifactId>

0 commit comments

Comments
 (0)