一个吭哧了半天的问题,我写了自定义注解,但是打断点进不来拦截,反复检查注解放的位置都没问题
最后锁定在jar包
看到一个博客自定义注解需要的两个jar web和aop 所以检查我自己的这两个jar包
1.web
修改前
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
修改后
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
2.aop
添加aop依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
3.自定义注解的配置类添加@Configuration注解
扫描二维码关注公众号,回复:
9067578 查看本文章