我正在处理Spring boot JPA Gridle project
,当前Swagger
正在运行,DTO
运行时出错,模块之间好像有冲突。
当我安装swagger
模块、继续使用swagger并安装DTO模块时,出现错误。以下模块产生错误:compile 'org.springframework.boot:spring-boot-starter-hateoas'
错误如下。
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-03-17 01:26:38.657 ERROR 4688 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
springfox.documentation.spring.web.plugins.DocumentationPluginsManager.createContextBuilder(DocumentationPluginsManager.java:152)
The following method did not exist:
org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;Lorg/springframework/plugin/core/Plugin;)Lorg/springframework/plugin/core/Plugin;
The method's class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:
jar:file:/Users/****/.gradle/caches/modules-2/files-2.1/org.springframework.plugin/spring-plugin-core/2.0.0.RELEASE/95fc8c13037630f4aba9c51141f535becec00fe6/spring-plugin-core-2.0.0.RELEASE.jar!/org/springframework/plugin/core/PluginRegistry.class
It was loaded from the following location:
file:/Users/****/.gradle/caches/modules-2/files-2.1/org.springframework.plugin/spring-plugin-core/2.0.0.RELEASE/95fc8c13037630f4aba9c51141f535becec00fe6/spring-plugin-core-2.0.0.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry
Process finished with exit code 1
我在搜索中尝试过的东西也是。
compile group: 'org.springframework.plugin', name: 'spring-plugin-core', version: '2.0.0.RELEASE'
compile group: 'io.springfox', name: 'springfox-data-rest', version: '2.9.2'
他们两个都没帮我。
有人和我有同样的问题吗?
有没有别的办法来解决这个问题?
3条答案
按热度按时间cyej8jka1#
问题是Swagger和Hateoas模块之间的冲突。多个搜索结果已经找到了解决方案。
解决方案是添加一个新模块并为其注册
Bean
。** Swagger 配置.java**
7bsow1i62#
对我来说,问题是JPA和Hateoas依赖关系之间的冲突。
我的解决方案是删除JPA依赖项,因为我对使用Hateoas模块感兴趣。
变更内容:
对此:
cgfeq70w3#
对我来说,这是Swagger和JPA之间的冲突,所以我不得不将SpringBoot从2. 1. 9-Release升级到2. 7. 5。