import org.springframework.test.context.junit4.SpringRunner;
无法解析测试包Spring Boot版本2.0.3 Gradle版本4.6 JDK 1.8
我正在使用IntelliJ社区版集成开发环境,我的操作系统是ubuntu-16.04
还尝试了:1-导入springframework.boot.test,但这也不起作用2-导航到项目目录并使用终端构建项目
我不喜欢手动导入库。
Gradle脚本:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.3.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
bootJar {
baseName = 'gs-spring-boot'
version = '0.1.0'
}
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
testCompile("junit:junit")
testCompile("org.springframework.boot:spring-boot-starter-test")
}
发布于 2018-07-20 18:30:13
语句:testCompile("junit:junit")
,不需要
依赖关系:
testCompile('org.springframework.boot:spring-boot-starter-test')
解析以下类:
import org.springframework.test.context.junit4.SpringRunner;
https://stackoverflow.com/questions/51440184
复制相似问题