Bug 131707

Summary: Cannot add classpath variables when starting with -pluginCustomization option
Product: [Eclipse Project] JDT Reporter: Maarten Coene <maarten_coene>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1.2   
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Proposed patch and regression test none

Description Maarten Coene CLA 2006-03-14 10:03:23 EST
Hi,

I have a properties file with custom Eclipse settings. If I define a classpath variable in this file, it is not picked up by eclipse.

Steps to reproduce:
1. Create a new file: mysettings.ini
2. Add the following property: org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.JAVA_REPOSITORY=C\:/working/repository
3. Start eclipse: 'eclipse.exe -pluginCustomization mysettings.ini'
4. Go to 'Window > Preferences > Java > Build Path > Classpath Variables'.

As you can see, the 'JAVA_REPOSITORY' variable is not listed there.

If I import this file with 'File > Import > Preferences', it works. However, I want to avoid this manual step.

regards,
Maarten
Comment 1 Jerome Lanneluc CLA 2006-03-17 04:28:26 EST
((IScopeContext) new InstanceScope()).getNode(JavaCore.PLUGIN_ID) doesn't contain the key "org.eclipse.jdt.core.classpathVariable.JAVA_REPOSITORY".

Moving to Platform Runtime.
Comment 2 DJ Houghton CLA 2006-03-17 06:25:01 EST
The plug-in customization mechanism is for customizing default properties, not instance (workspace) properties.

Your key/value pair should appear here:
   new DefaultScope().getNode(JavaCore.PLUGIN_ID)

Here is a small doc that I wrote up on plug-in customization:

http://www.eclipse.org/eclipse/platform-core/documents/user_settings/plugin_customization.html
Comment 3 Maarten Coene CLA 2006-03-17 07:23:51 EST
So there is no way to to add default classpath variables in Eclipse, which are available to all workspaces? 
If this is the case, could you add such functionality?

thanks,
Maarten
Comment 4 DJ Houghton CLA 2006-03-17 07:33:05 EST
When I add the value to the plugin customization file, it appears in the JDT default preferences. I do not know how the Jave -> Build Path -> Classpath Variables page/values are calculted though. Jerome?
Comment 5 Jerome Lanneluc CLA 2006-03-17 09:37:17 EST
Indeed we look at instance preferences only. I'll see what can be done here.
Comment 6 Jerome Lanneluc CLA 2006-04-05 09:40:34 EDT
Created attachment 37730 [details]
Proposed patch and regression test
Comment 7 Philipe Mulet CLA 2006-04-05 09:42:51 EDT
+1 for 3.2RC1
Comment 8 Jerome Lanneluc CLA 2006-04-05 10:09:44 EDT
Released patch and regression test
Comment 9 Frederic Fusier CLA 2006-04-13 13:26:12 EDT
Verified for 3.2 RC1 using build I20060413-0010.