Another tip: Using Spring Tool Suite that is a forked eclipse with Spring features saves you much time in installing plugins like m2e(maven plugin)
http://www.springsource.org/sts > -----Original Message----- > From: Alex Huang [mailto:alex.hu...@citrix.com] > Sent: Tuesday, March 05, 2013 5:07 PM > To: cloudstack-dev@incubator.apache.org > Subject: RE: Setting up a better eclipse environment.... > > Another tip I have is to create one source repo and workspace for one major > branch. We've been changing our environment a lot and it really messes > with the whole git checkout <branch> and then have eclipse reconfigure > automatically. It has the added benefit of working on multiple branches at > the same time simply by opening multiple eclipses. > > Just don't create workspaces in the directory you store your source. This > used to be okay for me back in the ant days but since the switch to maven, > eclipse has had really weird problems with that. Once I stored the workspace > outside of the source directory, everything works beautifully. > > --Alex > > > -----Original Message----- > > From: Alex Huang [mailto:alex.hu...@citrix.com] > > Sent: Tuesday, March 5, 2013 4:55 PM > > To: cloudstack-dev@incubator.apache.org > > Subject: Setting up a better eclipse environment.... > > > > Hi All, > > > > I've heard this from a couple of developers on eclipse and cloudstack. > > Thought I share this tip. > > > > When you open hit Shift-Ctrl-R on eclipse, it opens up the Open > > Resource dialogue. A lot of people do this as a quick way to get to a > > file. With CloudStack, many people see a bunch of .class files and > > three or four different .java files of the same name. > > > > Here's how to get rid of all of that. > > > > > > 1. Quit Eclipse > > > > 2. Make sure your workspace is not stored in the cloudstack directory. > > (This may be only my problem because I used to like to do that.) If > > your workspace is stored in the directory, you want to delete all > > eclipse metadata and create the workspace somewhere else. > > > > 3. Remove the eclipse generated bin directory from all of the > > directories. > > The reason is because CloudStack projects used to use bin as the > > directory for all the eclipse generated .class files but now with > > maven based projects, eclipse uses target/classes to store them. So > > now eclipse sees the .class files in the bin directories as resources > > that you own. That's why there's .class files in the Open Resource > > directory. > > > > 4. Remove all of the .project files. This is again because we used to > > checkin .project files and some of your .project files were not > > created from maven pom.xml. If you did this before, then you can skip > steps 5-8. > > > > 5. Start Eclipse. > > > > 6. If you deleted your workspace in step 2, then you should create a > new > > workspace. > > > > 7. Remove all of the projects. > > > > 8. Import all maven projects again. > > > > 9. Hit Shift-Ctrl-R to open resource dialogue > > > > 10. Click on the down arrow in the upper right of the dialogue box > > > > 11. Click on the Edit Active Working Set from the drop down menu > > > > 12. Create a working set called cloudstack > > > > 13. Add all of the projects to it and then remove the parent projects. > > The > > reason you want to remove them is because they're parent projects and > > when you open resource, the open resource dialogue gets the .java file > > from both the actual project and the parent projects so the same .java > > file appears more than once. > > > > o Cloudstack-framework > > > > o Cloud-engine > > > > o Cloudstack > > > > o Cloudstack-plugins > > > > o Cloud-services > > > > 14. Click on finish > > > > 15. Click on the top right drop down button again > > > > 16. Make sure "Show derived resources" is not checked > > > > Another easier way to do this may be to push all your commits and > > changes and then delete the source directory and reclone the repo. > > Then follow just steps 6-16. > > > > After doing that, when you hit Ctrl-Shift-R, make sure the CloudStack > > working set is selected. Now only the java file you want will show up. > > There's no .class files and no multiple copies of the same java files. > > > > --Alex