【发布时间】:2018-07-20 10:09:33
【问题描述】:
import org.springframework.test.context.junit4.SpringRunner;
无法解析测试包 Spring Boot 2.0.3 版 梯度版本 4.6 JDK 1.8
我正在使用 IntelliJ 社区版 IDE,我的操作系统是 ubuntu-16.04
还尝试过: 1-import 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")
}
【问题讨论】:
标签: spring-boot gradle build.gradle ubuntu-16.04 spring-boot-test