Spring - 自定义userDetailsS​​ervice

时间:2016-07-12 00:50:26

标签: spring spring-boot activiti

我在使用Spring Activiti进行Spring启动时遇到问题。我们定义了userDetailsS​​ervice,并且在没有添加activiti依赖的情况下工作正常。但是使用activiti,我的userDetailsS​​ervice被root userDetailsS​​ervice覆盖了

Overriding bean definition for bean '**userDetailsService**' with a different definition: replacing [Generic bean: class [com.partshub.security.UserDetailsService]; .....l; defined in file [C:\GFApps\spring-workspace\Spring-SPA\target\classes\com\partshub\security\UserDetailsService.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.activiti.spring.boot.SecurityAutoConfiguration$UserDetailsServiceConfiguration; factoryMethodName=userDetailsService; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/activiti/spring/boot/SecurityAutoConfiguration$UserDetailsServiceConfiguration.class]]

添加了Maven依赖

<dependency>
        <groupId>org.activiti</groupId>
        <artifactId>activiti-spring-boot-starter-basic</artifactId>
        <version>5.21.0</version>
    </dependency>

感谢您的帮助

1 个答案:

答案 0 :(得分:0)

添加以下属性条目修复了我的问题

spring.autoconfigure.exclude = "org.activiti.spring.boot.RestApiAutoConfiguration, org.activiti.spring.boot.SecurityAutoConfiguration, org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration"