I develop an Eclipse plugin which extends to Eclipse UI, and we deliver it as a whole Eclipse product. The plugin has as a target some automotive projects.
The version of the product can be configured from the project and executing a batch file will launch the proper version of the product.
So the final command will be something like this:
start /B %PRODUCT_PATH%/eclipse.exe -clean -configuration %PATH_TO_PROJECT_CONFIG% -data %PROJECT_PATH
The problem comes when switching from one product version to another, the .metadata
folder is corrupted or the information from it is not compatible between products, I am not sure what happens exactly but I get sporadic exceptions at startup.
When I clean the .metadata
and launch the product without an existing .metadata
folder in the project location, everything runs normally.
Is there an command line option for Eclipse to clean the workspace .metadata
before startup?
On a Windows operating systemRight-click on the file. View its Properties. If there is metadata that you would like to remove, select the Details tab. Click Remove Properties and Personal Information.
Open Eclipse and navigate to the Window > Preferences. Scroll down the left-hand panel in the Preferences window and click the Remote Systems drop-down root menu. 3. Click the Clear Cached Files button in the File Cache window.
It's possible to remove the workspace in Eclipse without much complications. The options are available under Preferences->General->Startup and Shutdown->Workspaces. Note that this does not actually delete the files from the system, it simply removes it from the list of suggested workspaces. It changes the org.
All (I think!) the Eclipse command line arguments can be found in the Runtime options section of the reference documentation.
I find nothing in that document about removing the .metadata
directory.
I have also searched for usage of the words "clean", "clear" and "remove", and reference to osgi.instance.area
(which and think is the OSGI term for the .metadata
directory) and found nothing that seems relevant.
clearPersistedState
You could try -clearPersistedState
option. Maybe that could help? (I don' really know the purpose of the option, I just found it in the documentation.)
Otherwise maybe you could have a start script which simply runs del
to remove the directory.
The best thing to do is of course to find the root cause of the startup problems and solve that. But maybe that is too time consuming or impossible in your case.
The .metadata
folder of the worksapce does not only contain caches but also the local history, the layout of the perspectives with their editors and views, and non-shared launch configurations are stored in the .metadata
folder. Therefore deleting the .metadata
folder is not a good idea.
Instead of cleaning the whole .metadata
folder find the root cause, the files causing the problem and write code that discards or migrates these data to the new format. The Eclipse bug 411602 is an example of such an issue that was caused by not migrated data stored in the .metadata
folder.
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