开发者

STS - Grails perspective broken. Can not see services

开发者 https://www.devze.com 2023-03-05 07:07 出处:网络
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 ex

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 broken. Can not see services

Thanks a lot, Bilsay


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"/>


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.


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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消