本文介绍了进行防护混淆后,与现有的具有相同名称和类的不兼容bean定义发生冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Proguard混淆之后,出现以下错误:

after Proguard obfuscation i get the following error :

我正在使用基于注释的spring配置,如何使用Proguard避免两个具有相同名称的类,因为Spring不允许两个bean具有相同的名称.

i'm using annotation based spring configuration , how can i avoid having two classes with the same name using Proguard because Spring doesn't allow two beans to have the same name.

推荐答案

我不确定这是否是您想要的,但是您可以在@Component(以及构造型@ Repository,@ Service和@Controller)中指定bean名称.值:

I'm not sure if this is what you want, but you can specify bean name in @Component (and stereotypes @Repository, @Service and @Controller) value:

@Component("myBeanName")
public class MyBean {

}

这篇关于进行防护混淆后,与现有的具有相同名称和类的不兼容bean定义发生冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 09:11