5 java spring gradle spring-boot
在以下行上无法解决导入org.springframework.web的问题:
import org.springframework.web.bind.annotation.*;
[...]
@RestController
[...]
@RequestMapping("/")
[...]
Run Code Online (Sandbox Code Playgroud)
这发生在我的Spring Starter项目中。我正在使用Spring与Gradle 2.x
我经常读到您需要更改build.gradle文件中的依赖项,但我不知道在其中添加什么。我的依存关系如下所示:
dependencies {
compile('org.springframework.boot:spring-boot-starter')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
Run Code Online (Sandbox Code Playgroud)
您需要添加 compile("org.springframework.boot:spring-boot-starter-web")
检查这个https://spring.io/guides/gs/spring-boot/#scratch
| 归档时间: |
|
| 查看次数: |
4964 次 |
| 最近记录: |