Community
Participate
Working Groups
The importing of preferences files that contain new classpath variable definitions does not take effect for projects in the workspace that already reference those variables. For example, let's say one checks out from CVS a Java project whose build path refers to the variable WAS_PLUGINDIR, but that variable is not currently set in the workspace. The project will have a build error because of the missing variables. Let's further say that there is a preferences file that contains the definition for WAS_PLUGINDIR: #Thu Sep 15 16:55:30 PDT 2005 org.eclipse.jdt.core/org.eclipse.jdt.core.classpathVariable.WAS_PLUGINDIR=C\:/users/mirko/e3/MinibankWSAD/WAS_PLUGINDIR After this file was imported using "Import -> Preferences" the new classpath variable shows up in the list ("Preferences -> Java -> Build Path -> Classpath Variables") but the project that refers to WAS_PLUGINDIR still shows a build error. Cleaning the project does not help; the project does not build even though all variables are properly set. The only work-around for this is going to the "Preferences -> Java -> Build Path -> Classpath Variables" dialog, and make a minor change to the variable's path value (for example, changing "C:" to "c:"). After that, the project will build properly. It does not matter whether one answers Yes or No to the question of whether a full build should be performed. It seems that the project somehow caches the information that the variable is undefined and that information does not get properly updated when the variable definition is imported into the workspace. The correct behavior that I would expect is that all projects build properly right after the classpath variable was imported. Unfortunately, the same problem happens when importing preferences via Preferences.importPreferences(...). We need to be able to import classpath variables programatically, so I'd definitely appreciate it if someone could let me know a programmatic work-around that would cause the dependent projects to be rebuilt properly.
Created attachment 37884 [details] Proposed patch and regression test
+1 for 3.2RC1
Released patch and test
Verified for 3.2 RC1 using build I20060413-0010.