我使用spring引导初始化程序创建了干净的项目,并得到了配置构建错误。我得到的信息是:Could not find org.junit:junit-bom:5.4.0-SNAPSHOT.,但是在我的gradle文件中我没有它。它有什么问题?
buildscript {
ext {
springBootVersion = '2.2.0.BUILD-SNAPSHOT'
}
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 11
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
implementation('org.springframework.boot:spring-boot-starter-security')
implementation('org.springframework.boot:spring-boot-starter-web')
testImplementation('org.springframework.boot:spring-boot-starter-test')
testImplementation('org.springframework.security:spring-security-test')
}发布于 2018-12-10 14:08:22
您正在使用Spring的开发(快照)版本,该版本引用了JUnit 5的开发(快照)版本,但还没有添加JUnit的快照存储库:https://oss.sonatype.org/content/repositories/snapshots/org/junit/junit-bom/5.4.0-SNAPSHOT/
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}但你最好使用通用的版本。
https://stackoverflow.com/questions/53705166
复制相似问题