Spring 使用Mongo但是报:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

发布于 / 随记 / 0条评论 / Tags: spring boot / 20 次浏览

Spring 使用Mongo但是报:Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.这个由于自己引入了JPA,Mongo是用不到JPA的。汗 - -!

去掉下面的以来即可


dependencies {
//    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-data-mongodb-reactive'
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-webflux'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'io.projectreactor:reactor-test'
}

    评论区(暂无评论)