首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我要在junit5中获得Gradle配置构建错误的IntelliJ?

为什么我要在junit5中获得Gradle配置构建错误的IntelliJ?
EN

Stack Overflow用户
提问于 2018-12-10 11:54:36
回答 1查看 239关注 0票数 1

我使用spring引导初始化程序创建了干净的项目,并得到了配置构建错误。我得到的信息是:Could not find org.junit:junit-bom:5.4.0-SNAPSHOT.,但是在我的gradle文件中我没有它。它有什么问题?

代码语言:javascript
复制
    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')
}
EN

回答 1

Stack Overflow用户

发布于 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/

代码语言:javascript
复制
repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

但你最好使用通用的版本。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53705166

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档