项目使用了公司的框架,有很多重复定义的bean,有一次在打包发布的时候,发现本地可以正常运行,打包后的jar一直报异常
Description:
The bean 'system-server.FeignClientSpecification' could not be registered. A bean with that name has already been defined and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
解决办法
1,按照提示在配置文件中,添加配置
spring.main. allow-bean-definition-overriding=true
添加这个之后,本地可以了,但打包后还是有问题
2,发现在pom文件中没添加对yaml文件的识别,给加上就好了
耗了我一天时间搞这个东西,做个记录
友情链接