Spring AOP Start
前话
因为Spring借鉴了AspectJ的切面技术,使用的方式和AspectJ注解切面完全一致
所以可以推出Spring AOP使用除了需要Spring Core依赖之外,还需要整合AspectJ的依赖包
什么是AspectJ
基于java的AOP实现的开发工具
官方文档
环境
- jdk1.8
- maven
所需依赖
pom.xml
<dependencies>
<!-- 核心依赖 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.3.14</version>
</dependency>
<!-- 整合AspectJ的依赖 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>5.3.14</version>
</dependency>
</dependencies>