I am using Spring 4.2.4.RELEASE in my web application and I would like to remove the dependency on aspectjweaver.jar from it. I don\'t use AOP directly and I certainly don\'
Adding spring-boot-starter-aop dependency would resolve the issue, if you are facing it in the springboot application.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
The answer is no. Spring AOP is syntactically an AspectJ subset, thus it uses AspectJ classes for parsing pointcuts. It also exposes AspectJ classes like JoinPoint
, ProceedingJoinPoint
and AspectJ annotations like @Poinctut
, @Before
, @After
, @Around
, @DeclareParents
etc.
I encountered this problem when using the @Transactional
annotation on a class annotated with @Component
in Spring Boot similar to: https://spring.io/guides/gs/managing-transactions/
The easiest way to fix it is to add the proper Maven dependency:
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.9</version>
</dependency>
Is there any way to completely remove the dependency on aspectjweaver.jar ?
No, you cannot. You are using Spring AOP. The Spring project spring-aop
does have a hard dependency on aspectjweaver.jar
. Read the Spring-aop docs that clearly identifies it as a dependency.