Eclipse(Springsource Tool Suite 2.3.1)无法解析同一包中类的依赖关系

发布于 2024-08-25 10:33:10 字数 470 浏览 5 评论 0原文

当我将 Springsource Tool Suite 从 2.3 升级到 2.3.1 时,这种情况开始发生。基本上,每当我做任何事情,例如打开文件、更改文件等时,我都必须进行清理。当我在命令行上执行 mvn 命令时,一切正常,这让我相信 Eclipse 正在错误的位置查找已编译的代码或类似的内容,尽管在这一点上这完全是迷信。

示例:我对 com.foo.mypackage.MyClass 进行了更改。突然,一堆执行 MyClass 的测试得到了红色 x - 未找到类!

在 src/main/test 中:

com.foo.DbUnitTest
com.foo.mypackage.FooTest extends DbUnitTest

DbUnitTest 获取未找到的类。我打扫干净了,一切都很好。我碰了一些东西,它又坏了:(。我真的不知道从哪里开始解决这个问题。

This started happening when I upgraded my Springsource Tool Suite from 2.3 to 2.3.1. Essentially whenever I do anything, such as open a file, change a file, etc, I have to do a clean. Everything works fine when I do mvn commands on the command line, which leads me to believe that Eclipse is looking in the wrong place for compiled code or something along those lines, although that is entirely superstitious at this point.

Example: I make a change to com.foo.mypackage.MyClass. Suddenly a bunch of tests that excercise MyClass get the red x - for class not found!

In src/main/test:

com.foo.DbUnitTest
com.foo.mypackage.FooTest extends DbUnitTest

DbUnitTest gets a class not found. I do a clean, and everything is fine. I touch something, and it breaks again :(. I don't really know where to begin on how to troubleshoot this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

单挑你×的.吻 2024-09-01 10:33:10

第一个起点是在 Eclipse 中从包资源管理器中选择项目,右键单击它并选择

Maven > Update Project Configuration

“这通常会让事情恢复原样”。

The first starting point is in eclipse to select the project from the package explorer, right click it and select

Maven > Update Project Configuration

This usually gets things back in shape.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文