我使用gradle
使用mongo依赖但是得到例外:
Could not resolve: org.mongodb:mongodb-driver:3.6.3
Could not resolve: org.springframework.data:spring-data-mongodb:2.0.6.RELEASE
Could not resolve: org.mongodb:mongo-java-driver:3.6.3
我的Gradle文件如下所示:
repositories {
mavenCentral()
}
configurations.all {
exclude group: "commons-logging", module: "commons-logging"
}
dependencies {
compile 'org.mongodb:mongodb-driver:3.6.3'
compile 'org.springframework.data:spring-data-mongodb:2.0.6.RELEASE'
compile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.6.3'
testCompile("org.testng:testng:${testNGVersion}")
testCompile("junit:junit:${jUnitVersion}")
testCompile("org.mockito:mockito-core:${mockitoVersion}")
}
有人可以帮助我,为什么我会超越异常。
答案 0 :(得分:0)
只需转到https://start.spring.io/,选择使用'Java'生成'Gradle Project'以及您想要的任何Boot版本,在“搜索依赖项”中键入mongo
并下载项目。