在很多SpringBoot項目中,common或者parent 做了shiro依賴,這樣其他模塊項目 總是提示 No bean of type 'org.apache.shiro.realm.Realm' found
Action:
Please create bean of type 'Realm' or add a shiro.ini in the root classpath (src/main/resources/shiro.ini) or in the META-INF folder (src/main/resources/META-INF/shiro.ini).
其實就是SpringBoot自動加載機制,在
shiro-spring-boot-starter 有默認配置。所以需要屏蔽shiro 怎麼辦???這是第二次哉到這裏了
自己亂琢磨 在
@SpringBootApplication( 輸入 ShiroAutoConfiguration 把出現的三個匹配的項目排除 就可以了
@SpringBootApplication(exclude = {ShiroAnnotationProcessorAutoConfiguration.class, ShiroAutoConfiguration.class, ShiroBeanAutoConfiguration.class})
就ok了 真好 休息一下。。