java - Gradle 将编译 spring-boot-starter-web 更改为 implementation 导致错误:包 org.springframework.http 不存在
问题描述
我目前正在将项目从使用编译转换为使用 Gradle 5.4.1 的实现。
我遇到了一个问题,使用以下方法可以正常工作:
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.2.2.RELEASE'
如果以下情况没有:
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.2.2.RELEASE'
使用实现会导致出现以下错误:
/Path/To/File/AFileName.java error: package org.springframework.http does not exist
import org.springframework.http.HttpStatus;
^
我在这两种情况下都特别指定了发布版本 2.2.2,因此它不应该通过更改 HttpStatus 的类位置来获取更新的版本。
有谁知道可能导致这种破坏行为的原因是什么?
解决方案
推荐阅读
- c# - “Auth”不包含“SignIn”的定义,并且没有可访问的扩展方法“SignIn”接受“Auth”类型的第一个参数
- google-chrome - chrome 睡眠后黑屏
- linux - Puppet Could not find command 'cd'
- c# - 如何使用本地 SQL Server 数据库为应用程序创建安装包
- ruby - 第一个和最后一个元素 ruby 有 [" 和 "]
- c++ - 调用 exit() quit() 或 terminate() 后 Qt 线程执行不会停止
- javascript - 我必须等待无效的异步功能吗?
- google-chrome-devtools - 是否可以使用 Chrome DevTools 找出哪些标签可见?
- r - 如何在 R 中以这种方式展平数据框?
- python - 在大型数据框中降低因子级别的 Pythonic 方法