【问题标题】:In which file we add dependencies in gradle? Like while using maven we can add dependencies in pom.xml我们在 gradle 的哪个文件中添加依赖项?就像使用 maven 一样,我们可以在 pom.xml 中添加依赖项
【发布时间】:2018-10-30 09:57:55
【问题描述】:

我有这个代码:

import org.springframework.web.bind.annotation.RequestMapping;@RequestMapping("/login")

导入后报错

无法解析符号请求映射

我无法解决这个问题。
有人可以提出解决方案吗?

【问题讨论】:

  • 检查符号requestMapping是否定义在发生错误的范围内。

标签: spring maven spring-boot gradle intellij-idea


【解决方案1】:

在 build.gradle 文件中添加依赖项。

dependencies {
    compile('org.springframework.boot:spring-boot-starter-actuator')
    compile('org.springframework.boot:spring-boot-starter-web')
    testCompile('org.springframework.boot:spring-boot-starter-test')
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-05-19
    • 2013-03-15
    • 1970-01-01
    • 2015-12-08
    • 1970-01-01
    • 2018-11-07
    • 2014-12-17
    相关资源
    最近更新 更多