Java – automatically configure the eclipse workspace

I have an eclipse workspace that consists of 15 different Java projects To configure the eclipse workspace, each time I need to manually add a java project and add dependencies and references in the Java build path

I don't need to add the same project multiple times, but I often need to create a new eclipse workspace with new code changes and deliveries (I can't make some changes in the current workspace) If someone needs to create an eclipse workspace over and over again, or if multiple people need to create the same workspace for their work How can we reduce manual operations?

Solution

I'm still a little uncertain about your motivation, but I'll assume that through new code changes and delivery, you mean different revisions / branches of the same code base For this and many other reasons, if you don't use a source control like SVN or git, check it out These tools are priceless and free

solar eclipse

I don't think this is technically part of your problem, but I want to add it as integrity If you are implementing the following technologies, it is also convenient to perform a "full eclipse" I kept a "full eclipse" on the network drive and pre installed some plug-ins so that the team's new features don't have to download / install plug-ins This is not difficult because eclipse does not require "installation" You can copy the eclipse folder to the location you want and run it I personally like plug-ins that include source control, code style, code coverage and metrics, but you should include any plug-ins you have always used in the project

work area

To copy an existing workspace (not including any items, which I'll cover later), you just need to The metadata folder is copied from an existing workspace folder to an empty folder that will be the new workspace folder When you start eclipse, simply select a new workspace folder and you will have the same preferences as in other workspaces

I've used this technology before so that when people join a project, they can copy a "clean workspace" and save it on a network drive to help them start and run quickly Preferably, this "clean workspace" should not only have personal preferences, such as setting the perspective in the way you like, but should only have preferences such as ant global properties, compiler compliance level, and pre made common external tools And run configuration, etc

project

For the projects themselves, I recommend checking them into source control, including eclipse Project and Classpath file The SVN plugin (subclipse) makes this easy to implement Then, when someone joins your project, all they have to do is check them as projects in the new "clean workspace", which is also very easy Because the item you are checking out already has Project and Classpath file, so all dependencies have been set! Just make sure that all jars and any other dependencies are checked in with the project

Workspace setup process

>Take a copy of the 'full eclipse'. > Copy a "clean workspace" > Check out the project to this workspace

nothing more! Your recruits should be ready!

Multiple code branches

Now, if I think it's right to mean different branches of the same code base through new code change and delivery, creating workspaces for different branches is as simple as following the same steps, but check the required revisions or branches instead of the latest version from the trunk If you don't quite understand what I mean, please read source control

CUDOS

I'm good at taking time to do this. I've been spending a day in the project to set up

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>