在 STS 中标记二进制文件的出现次数
我在Spring STS中使用maven创建了一个项目。我打开一个源文件(由 maven 自动下载的类文件)并将光标放在类中未突出显示的方法/变量上。我该如何解决这个问题?
I have created a project using maven in Spring STS. I opened a source file(class file which is downloaded by maven automatically) and placed cursor on methods/variables those occurrences not highlighted in class. How can I fix that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这很复杂,而且它不是 Maven 或 STS bug。相反,它是一个 Eclipse JDT bug。除非可以使用当前项目的类路径来类加载类文件及其所有依赖项,否则标记出现无法工作。因此,相关类必定缺少某些依赖项。它可能在运行时通过 Maven 可用,但在编辑时不可用。
解决这个问题非常棘手,但是您可以首先将所有传递依赖项显式添加到 pom.xml 中。
This is complicated and it is not a maven or an STS bug. Rather, it is a Eclipse JDT bug. Mark occurrences cannot work unless the class file and all of its dependencies can be classloaded using the current project's classpath. So, there must be some dependency that is missing for the class in question. It is probably available at runtime through maven, but just not at edit time.
It is very tricky to fix this problem, but you can start by explicitly adding all transitive dependencies to your pom.xml.