I have multiple projects that are stored on my local computer but are not in the Eclipse workspace that I am working from. But when I open the same Eclipse workspace the projects are there. How is this achieved ? Is there a setting in the metadata of the workspace which dictates where the project is stored ? Are there any advantages of using such an approach instead of storing the projects in the workspace ?
The workspace is designed as a logical container of projects, it just so happens that it can also be a physical container for them, too. Many times you want or need to store a project's contents in some place on your file system that is outside your workspace. One common example is with certain source control systems, you check files out into a location that's managed by the version control system (such as git, Perforce, VSS, etc). In that case, you need to have the Eclipse Project look for its contents in the version-tool-managed location instead of the Eclipse workspace.
Many people, like myself, just like to keep projects organized in my file system in different ways that aren't tied to a particular workspace. Another reason, though less common, is to have the same project loaded into two different workspaces. Remember, the workspace is a logical or virtual container; it won't always be exactly how you want projects organized on disk. If your projects are stored outside the workspace(s), that allows workspaces to be transient in the sense that you can create/delete them at will without losing your project contents.
Each project has its own folder in the <workspace>\.metadata\.plugins\org.eclipse.core.resources\.projects\
folder. In each project folder (of a project outside your workspace) is a file called .location
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With