java - 使用 Java 11 和 Cassandra Spring Unit 可能与 lombok 和 gradle 一起使用时 Eclipse 出现问题
问题描述
所以我遇到了一个项目的问题。Eclipse 会说 java.util.* 有导入错误的地方The package java.util is accessible from more than one module: <unnamed>, java.base
我挖了很多,似乎由于某种原因没有其他人真正遇到这个问题。我们办公室的每个人都是。他们告诉我,虽然我认为 2018 年的 Eclipse RC 版本可以工作,但这是他们唯一可以让它工作的版本。我稍后会尝试发布真实版本。所以我搜索了很多,然后开始使用包含的 gradle 文件。并发现问题仅在我包含 Cassandra-unit-spring testCompile 要求时才存在,因此它只会在测试用例方面引起问题。
我的假设是,这在某种程度上是 eclipse 的一个错误,因为 gradle 本身没有问题。以及 intelij。让我知道我还能在这里提供什么来进一步缩小范围。
Eclipse Build id: 20190917-1200
Eclipse with Lombok Lombok v1.18.10
Gradle 5.6.4
Oracle JDK 11.0.5
tried cassadnra-unit-spring versions 3.5.0.1 - 3.11.x
Also using spring boot 2.1.3.release
谢谢。
解决方案
I have excluded all (transitive) dependencies of cassandra-unit
and re-included them one by one. Eventually, I found out that the library com.boundary:high-scale-lib
, i.e., a transitive dependency included by org.apache.cassandra:cassandra-all
, is responsible for the import errors.
The library is not Java 9+ ready, since it uses a java.base package name, i.e., java.util. This is not allowed. Unfortunately, you cannot exclude this transtive dependency, since it is required.
I found out that the release version of Eclipse 4.10 does not indicate errors in projects using the library. This is probably a UI bug in newer Eclipse versions, since I can compile and build my application with Gradle without any errors.
You can try this Eclipse version.
推荐阅读
- git - Sourcetree 未检测到对 .dll 文件的更改
- java - ftps 服务器错误 GnuTLS 错误 -89: 公钥签名验证失败
- reactjs - 迁移到 reactJS 16 单击链接不会更新视图
- php - 相同的对象,但缺少一个属性值
- r - 在闪亮的 R 中使用 JS 事件函数两次来创建下拉菜单
- c# - 将 TabControl 放在 Grid 内会出现错误
- ios - 我怎样才能使用 SnapKit 实现这一点?
- windows - 在 Windows 10 上安装自定义应用程序期间出现错误 1723
- ignite - 如何在 SqlQuery 中使用枚举值?
- java - 创建名称为“flightController”的 bean 时出错:通过字段“flightrepos”表示的依赖关系不满足;