Spring boot 弹簧数据休息模块2.1.3和摆动器2.9.2导致问题

Spring boot 弹簧数据休息模块2.1.3和摆动器2.9.2导致问题,spring-boot,spring-data-rest,swagger-2.0,Spring Boot,Spring Data Rest,Swagger 2.0,我正在尝试将spring数据rest模块与swagger ui相适应,我正在使用SpringBoot 2.1.3.RELEASE版本和2.9.2版本作为swagger依赖项,其中包括springfox数据rest、springfox-swagger 2、springfox swagger ui An attempt was made to call the method org.springframework.data.repository.support.Repositories.getRep

我正在尝试将spring数据rest模块与swagger ui相适应,我正在使用SpringBoot 2.1.3.RELEASE版本和2.9.2版本作为swagger依赖项,其中包括springfox数据rest、springfox-swagger 2、springfox swagger 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})
但是没有固定的


有人知道我为什么会出现这个错误吗?

我也遇到了同样的问题,并找到了以下解决方案:

使用了Swagger 3.0.0的快照版本

<dependencies>
    ...
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>3.0.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>3.0.0-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-data-rest</artifactId>
        <version>3.0.0-SNAPSHOT</version>
    </dependency>
    ...
</dependencies>

<repositories>
    <repository>
        <id>JFrog</id>
        <name>JFrog Snapshot Repository</name>
        <url>http://oss.jfrog.org/artifactory/oss-snapshot-local/</url>
    </repository>
</repositories>

正如这里提到的:

请展示您的
pom.xml
-看看这里的评论,也许您不知道。有了这样的回答,你很快就会摆脱困境。(请理解,我不能推翻这个答案,我只能说它确实试图回答,但从技术上讲它是否正确和有用。祝你好运。)
@SpringBootApplication
@EnableSwagger2WebMvc
@Import(SpringDataRestConfiguration.class)
public class MyApplication {

    public static void main(String[] args) {
        SpringApplication.run(MyApplication.class, args);
    }

}