Spring Boot AOP 不生效排查

目录

  • 目录
  • 1.未开启增强代理@EnableAspectJAutoProxy
  • 2. 未导包

欢迎各位补充

1.未开启增强代理@EnableAspectJAutoProxy

@SpringBootApplication
@EnableAutoConfiguration
@EnableAspectJAutoProxy(proxyTargetClass=true)
@Configuration
@ComponentScans({ 
    @ComponentScan("xx.xxx.xxx")
})
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

2. 未导包

<dependency>
    <groupId>org.aspectjgroupId>
    <artifactId>aspectjrtartifactId>
dependency>
<dependency>
    <groupId>org.aspectjgroupId>
    <artifactId>aspectjweaverartifactId>
dependency>

你可能感兴趣的:(Java,spring-boot)