【发布时间】:2019-03-21 16:32:49
【问题描述】:
我正在尝试使用 swagger-ui 调整 spring data rest 模块,我正在使用 SpringBoot 2.1.3.RELEASE 版本和 2.9.2 版本的 swagger 依赖项,其中包括 springfox-data-rest 、 springfox-swagger2、springfox-招摇-ui。
An attempt was made to call the method org.springframework.data.repository.support.Repositories.getRepositoryInformationFor(Ljava/lang/Class;)Lorg/springframework/data/repository/core/RepositoryInformation; but it does not exist. Its class, org.springframework.data.repository.support.Repositories, is available from the following locations:
jar:file:/Users/batuhan.apaydin/.m2/repository/org/springframework/data/spring-data-commons/2.1.5.RELEASE/spring-data-commons-2.1.5.RELEASE.jar!/org/springframework/data/repository/support/Repositories.class
It was loaded from the following location:
file:/Users/batuhan.apaydin/.m2/repository/org/springframework/data/spring-data-commons/2.1.5.RELEASE/spring-data-commons-2.1.5.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.data.repository.support.Repositories
我也尝试添加
@Import({springfox.documentation.spring.data.rest.configuration.SpringDataRestConfiguration.class})
但没有任何问题。
有人知道我为什么会收到这个错误吗?
【问题讨论】:
-
请出示您的
pom.xml-
标签: spring-boot spring-data-rest swagger-2.0