Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 172894 - Eclipse resolves soft linked directories
Summary: Eclipse resolves soft linked directories
Status: CLOSED DUPLICATE of bug 233019
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.2.1   Edit
Hardware: Other Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-05 13:05 EST by Andrew Robinson CLA
Modified: 2012-12-18 14:06 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Robinson CLA 2007-02-05 13:05:41 EST
When adding a new Java project to my workspace the following is the path I give it:

/home/andrew/java/project

where "java" is a symlinked path. The "real" path is:

/home/andrew/java-abc/project

I do it this way, so I can point java to any branch of my code (where abc is the branch in this example) and just restart Eclipse for it to pull the sources from another branch.

The problem is that eclipse adds the project as "/home/andrew/java-abc/project" even though I explicitly tell it to use "/home/andrew/java/project". The only work-around that I have found is to:

cd ~/
delete java
mv java-abc java
eclipse
(add project)
close eclipse to make sure it saves the workspace
mv java java-abc
ln -snf java-abc java

IMO, Eclipse should not rename folders when it is explicitly told to use a given path. BTW - this applies to:

File>New>New Project>Java project>Create project from existing source
Comment 1 Jerome Lanneluc CLA 2007-04-26 04:33:41 EDT
I'm not sure how the project from existing resources is created.
Moving to JDT/UI to investigate.
Comment 2 Benno Baumgartner CLA 2007-04-26 10:13:52 EDT
We create the project in org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathsBlock.createProject

IProjectDescription desc=
              project.getWorkspace().newProjectDescription(project.getName());
desc.setLocationURI(locationURI);
project.create(desc, monitor);

With a locationURI like: file:/somewhere/java/project
where java is the symlink
Comment 3 Benno Baumgartner CLA 2007-04-26 10:21:55 EDT
Not sure if it is possible at all with the symlink.

Another workaround you may want to try is to use a linked source folder:
1. On your java project click right
2. Build Path>Link Source...
3. Provide the location of the branch you want to use
4. Provide a folder name
5. Finish

Instead of a fixed location you can also define a variable pointing to the location. To switch the branch change the value of the variable on the General>Workspace>Linked Resources Preference Page. HTH
Comment 4 Markus Keller CLA 2012-12-18 14:06:43 EST

*** This bug has been marked as a duplicate of bug 233019 ***