java - Eclipse 看不到 Gradle 提供的 jar
问题描述
我们有一个我正在尝试在 Eclipse 中使用的 Gradle 项目。在其他用户进行更改并且我不得不进行 Gradle Refresh 之后,Eclipse 现在无法编译该项目。
The project was not built since its build path is incomplete. Cannot find the class file for
org.springframework.retry.support.RetryTemplate. Fix the build path then try building this project
The type org.springframework.retry.support.RetryTemplate cannot be resolved. It is indirectly
referenced from required .class files RabbitMQConfig.java /Account/src/main/java/com/efi/metrix/config line 1 Java Problem
如果我使用 Ctrl-T,我可以看到该类及其所在的 jar。该 jar 位于类路径中,可以在 Package Explorer 的“项目和外部依赖项”部分下看到。
我尝试删除 jar 并重新运行 Gradle Refresh,它会再次下载 jar,但构建失败时出现相同的错误。我还在该项目上尝试了 Eclipse Clean。(我也尝试过重新启动 Eclipse。)
关于可能导致这种情况的任何提示?
解决方案
终于找到了这个。Eclipse 项目,Properties -> Java Compiler -> Errors/Warnings 在“Enable annotation-based null analysis”部分,如果启用了“Inherit null annotations”,则会出现编译错误。我关闭了该选项,它现在编译没有错误。
推荐阅读
- mysql - MYSQL 键主键的重复条目“0”
- python - 如何制作具有 pdf 文件属性的 Python 对象?
- python - 如何将每个配对值作为单独的列表 |python|
- javascript - Redux-saga 调用多个动作/函数以进行调度
- vue.js - 如何将 socket.io-client 导入每个组件?
- c# - Autofac中基于Environment的不同DI实现
- javascript - 如何在 socket express.js 中使用 req 和 res
- javascript - 如何创建动态组件
- powerapps - 如何将变量从 PowerApp 传递到 PowerApp 流的 HTTP 步骤?
- python - 异步例程中的 For 循环不更新循环变量。如何使画布坐标异步实时?