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

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'
}

添加新评论