引入aspectjrt
org.aspectj aspectjrt1.9.7
自定义注解
切面方法
service中使用自定义注解
controller中
Service中点击左侧小图标进入切面方法,理论上没有问题。项目启动没有问题,调用接口也没有问题,service方法正常执行。
但是切面方法没有执行......
解决办法
org.aspectj aspectjrt1.9.7 org.aspectj aspectjweaver1.9.7
springboot中切面的使用需要引入两个包,只有aspectjrt的话,就会出现上述问题,不会报错,但就是切面方法不执行,aspectjweaver依赖会将切面方法织入到所需的地方,所以必不可少!
springboot启动类加上 (不影响,可加可不加)
@EnableAspectJAutoProxy(proxyTargetClass = true)



