自定义注解不起作用

一个吭哧了半天的问题,我写了自定义注解,但是打断点进不来拦截,反复检查注解放的位置都没问题

最后锁定在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 查看本文章
发布了50 篇原创文章 · 获赞 2 · 访问量 9415

猜你喜欢

转载自blog.csdn.net/qq_35653822/article/details/103540137