Bug 57732 - [buildpath] relative build classpath leading outside of eclipse workspace
Summary: [buildpath] relative build classpath leading outside of eclipse workspace
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 166572 (view as bug list)
Depends on: 248466
Blocks: 248583
  Show dependency tree
 
Reported: 2004-04-07 09:29 EDT by Simon Jefferies CLA
Modified: 2011-06-20 13:42 EDT (History)
5 users (show)

See Also:


Attachments
Proposed fix and regression tests (29.27 KB, patch)
2008-09-25 10:16 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Jefferies CLA 2004-04-07 09:29:26 EDT
It would also be useful to be able to specify relative paths in a .classpath 
file, that branches out from the .classpath file location (project location) in 
the actual windows file system, rather than just the workspace file system.  
Presently we have to use classpath variables such as...

<classpathentry kind="var" path="VIEW_ROOT/Build/jh2.0/javahelp/lib/jh.jar"/>

Where we would like to be able to just use...

<classpathentry kind="var" path="../../Build/jh2.0/javahelp/lib/jh.jar"/>

which would not require the setting of the VIEW_ROOT variables for eclipse to 
find required resources.  This is very useful in setting up eclipse projects 
and sharing/importing Team Project Sets.  The setting of one variable may seem 
trivial, but to developers new to eclipse or indeed programming in general, 
this step is just one more unnecessary hurdle.  May I even suggest a new 'kind' 
so that eclipse knows to look from the .classpath file location, such 
as 'local'.
Comment 1 Philipe Mulet CLA 2004-04-07 09:56:18 EDT
Interesting ideas, but not for 3.0
Comment 2 Frederic Fusier CLA 2007-06-20 04:21:35 EDT
*** Bug 166572 has been marked as a duplicate of this bug. ***
Comment 3 Jerome Lanneluc CLA 2008-09-11 09:15:10 EDT
Reopening to consider for 3.5
Comment 4 Jerome Lanneluc CLA 2008-09-11 09:15:51 EDT
Will investigate for 3.5M3
Comment 5 Jerome Lanneluc CLA 2008-09-25 10:16:05 EDT
Created attachment 113459 [details]
Proposed fix and regression tests
Comment 6 Jerome Lanneluc CLA 2008-09-25 10:20:42 EDT
Cannot release until bug 248466 is fixed.
Comment 7 Jerome Lanneluc CLA 2008-09-25 10:39:16 EDT
Entered bug 248583 for the JDT/UI work.
Comment 8 Jerome Lanneluc CLA 2008-09-26 05:14:59 EDT
Fix and test released for 3.5M3.

Note that one can use this feature by editing the .classpath for now. UI work can be followed in bug 248583.
Comment 9 Jerome Lanneluc CLA 2008-10-01 07:19:23 EDT
To clarify, note that the ".." is supported for library entries and variable values. A container can also have a library entry with a "..". Other classpath entry paths (such as source entries) cannot have a "..".
Comment 10 Olivier Thomann CLA 2008-10-27 15:04:25 EDT
Seems to work for '..' inside variable path or library path.
This doesn't work:
	<classpathentry kind="var" path="HOME/../../../../java_tools/lib/als.jar"/>.

If this is intended, then verified for 3.5M3 using I20081026-2000.
Comment 11 Jerome Lanneluc CLA 2008-10-29 10:41:05 EDT
(In reply to comment #10)
> Seems to work for '..' inside variable path or library path.
> This doesn't work:
>         <classpathentry kind="var"
> path="HOME/../../../../java_tools/lib/als.jar"/>.
> 
> If this is intended, then verified for 3.5M3 using I20081026-2000.
Yes this is intended. ".." in variable path is not supported. ".." is supported in variable value.

Comment 12 Nobody - feel free to take it CLA 2008-12-18 06:46:22 EST
Hi, are there any plans to implement relative source paths as well?
Comment 13 Jerome Lanneluc CLA 2009-01-06 07:18:33 EST
(In reply to comment #12)
> Hi, are there any plans to implement relative source paths as well?
> 
Sorry no plan to support relative source paths. Please enter a separate bug and provide a patch if this is important to you.
Comment 14 David Wegener CLA 2009-04-22 00:55:35 EDT
Although the current status of this bug is Fixed/Verified, I think it should be re-opened because the current implementation has limited use.

The lib paths are relative to the workspace location.  This makes the feature useless to developers who wish to use relative paths for projects aren't contained in their workspaces.  It would be much more useful if the paths were relative to the project.  As an example, consider a workspace rooted at /home/user1/workspace.  The workspace references a project rooted at /development/component/project1.  There is a directory of jars that project1 depends on at /development/component/lib.

The logical use for the relative path here would be to define an lib entry in project1 such as <classpathentry kind="lib" path="../lib/some.jar">.  The expectation would be that this would reference /development/component/lib/some.jar.  However, the current implementation would resolve this to /home/user1/workspace/lib/some.jar.