无法解析导入org.springframework.web发生在以下行:
import org.springframework.web.bind.annotation.*;
[...]
@RestController
[...]
@RequestMapping("/")
[...]
这发生在我的Spring Starter项目中.
我正在使用Spring with Gradle 2.x.
我经常读到你需要在build.gradle文件中更改你的依赖项,但我不知道在那里添加什么.我的依赖关系如下:
dependencies {
compile('org.springframework.boot:spring-boot-starter')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
解决方法:
你需要添加
编译(“org.springframework.boot:弹簧引导起动网”)
检查这个https://spring.io/guides/gs/spring-boot/#scratch
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。