STS - Grails 透视图被破坏。看不到服务

发布于 2024-11-06 20:59:42 字数 334 浏览 2 评论 0原文

我正在使用 STS 进行 grails 开发,但我不知道我做了什么(很可能错误地将文件夹拖到了某个地方),但现在我无法从角度看到我的服务。它们确实存在于 grails-app/services 下,但我想有些东西不再指向那里了?

是的,我尝试重新启动 STS,将项目重新加载到 STS。

知道如何解决这个问题吗?

编辑:

您现在看到的是透视图,没有显示任何服务。

无服务的 sts grails 视角

非常感谢, 比尔赛

I am using STS for grails development and i don't know what I did, (most probably dragged a folder somewhere by mistake) but now I can't see my services in the perspective. They do exists under grails-app/services but I guess something is not pointing there anymore?

and yes I tried restarting STS, reloading the project to STS.

Any idea on how I can fix this?

EDIT:

You are right here is the perspective view with no services shown.

sts grails perspective without services

Thanks a lot,
Bilsay

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

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

发布评论

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

评论(5

趁微风不噪 2024-11-13 20:59:42

您可以通过添加以下两行来修改文件 .classpath:

<classpathentry kind="src" path="grails-app/services"/>
<classpathentry kind="src" path="grails-app/taglib"/>

you can modify your file .classpath by adding these two lines :

<classpathentry kind="src" path="grails-app/services"/>
<classpathentry kind="src" path="grails-app/taglib"/>
披肩女神 2024-11-13 20:59:42

我以前没见过这个问题。如果上面的答案没有帮助,我会推荐以下内容;

  1. 打开错误日志。您看到任何相关错误吗?如果是这样,请将它们添加到您的问题中。
  2. 尝试创建一个新的 Grails 项目。您看到那里的服务文件夹了吗?
  3. 尝试在新位置创建新工作区。导入 grails 项目。您现在看到服务等级了吗?
  4. 如果一切都失败了,我建议在 http://issuetracker.springsource.com/browse 上提出错误报告/STS 尝试附加失败的项目。

编辑

我能够重现与您的问题类似的问题。我认为发生的情况是您的服务文件夹以某种方式从 Eclipse 类路径中删除了。您可以转到包资源管理器。找到 grails-app/services 文件夹。右键->构建路径->添加到构建路径。然后,它应该出现在项目资源管理器中。

I have not seen this problem before. If the answer above does not help, I would recommend the following;

  1. Open the error log. Do you see any relevant errors? If so, then please add them to your question.
  2. Try creating a new grails project. Do you see the service folder there?
  3. Try creating a new workspace in a new location. Import the grails project. Do you now see the service class?
  4. If all else fails, I'd recommend raising a bug report on http://issuetracker.springsource.com/browse/STS Try to attach a failing project.

EDIT

I was able to reproduce something similar to your problem. I think what happened is that your service folder was somehow removed from the Eclipse classpath. You can go to the package explorer. Find the grails-app/services folder. Right-click -> Build path -> Add to build path. Then, it should appear in the project explorer.

深海夜未眠 2024-11-13 20:59:42

尝试找到窗口->显示视图->从菜单栏中选择 Project Explorer,然后单击 Project Explorer。如果不亲眼所见,很难判断问题出在哪里,但这也许会有所帮助。祝你好运!

用新想法编辑
另一种可能性:通过搜索或在 Windows 上使用“打开资源”(或 CTRL+SHIFT+R)在编辑器中打开服务文件之一。然后,如果您单击项目资源管理器顶部的“与编辑器链接”双向箭头图标,则活动服务文件及其位置应自动在项目资源管理器中突出显示。也许这会给你的 STS 带来一些启发。

Try to find Window -> Show View -> Project Explorer from the menu bar and click on Project Explorer. It's hard to tell what the problem is without seeing it, but maybe that will help. Good luck!

Edited with new idea:
One more possibility: Open one of your service files in the editor, via searching or using "Open Resource" (or CTRL+SHIFT+R) on windows. Then if you click on the "Link with Editor" bidirectional arrow icon at the top of your Project Explorer, the active services file and its location should automatically be highlighted in the Project Explorer. Maybe this will knock some sense into your STS.

回忆那么伤 2024-11-13 20:59:42

从头开始,删除所有eclipse文件
(@参见https://github.com/github/gitignore/blob/ master/Global/Eclipse.gitignore)

运行 grailsintegrate-with--eclipse

并再次导入项目

start again from scratch, delete all the eclipse files
(@see https://github.com/github/gitignore/blob/master/Global/Eclipse.gitignore)

run grails integrate-with --eclipse

and import the project in again

情感失落者 2024-11-13 20:59:42

一周前我创建的一个新项目也发生了类似的事情。我看不到控制器。我通过转到包资源管理器修复了它。右键单击控制器 ->构建路径->用作源文件夹。安德鲁的上述回答有帮助。

Similar thing had happened to me on a new project I created a week ago. I was not able to see Controllers. I fixed it by going to the package explorer. Right-clicked on controllers -> Build path -> Use as Source Folder. Andrew's answer above helped.

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