【发布时间】:2018-02-13 14:59:44
【问题描述】:
import org.springframework.web 无法解析发生在以下几行:
import org.springframework.web.bind.annotation.*;
[...]
@RestController
[...]
@RequestMapping("/")
[...]
这发生在我的 Spring Starter 项目中。
我正在使用 Spring 和 Gradle 2.x
我经常读到您需要更改 build.gradle 文件中的依赖项,但我不知道在其中添加什么。我的依赖项如下所示:
dependencies {
compile('org.springframework.boot:spring-boot-starter')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
【问题讨论】:
-
如果你想做 Web 开发,
spring-boot-starter-web怎么样..
标签: java spring spring-boot gradle