4

In our Eclipse plugin are we managing some resources using navigator. For every folder in the navigator Eclipse is creating an .project file which leads to some problem in the code under resource management.

One way is to filter .project file pragmatically. But I wonder if there is a configuration or setting in Eclipse to prevent creation of .project files for the maps under navigator?

Lii
  • 11,553
  • 8
  • 64
  • 88
Govan
  • 2,079
  • 4
  • 31
  • 53
  • I never observed this behavior; are you sure those folders were not imported as projects prior to navigation? – Art Licis Sep 24 '12 at 11:20
  • I removed the all .project files and started our plugin which in startup is performing update workspace. After update workspace all the files was created again. The files are xml files and we are preforming schema validation under startup! – Govan Sep 24 '12 at 11:23

2 Answers2

2

.project files created by Eclipse IDE is essential cannot be prevented from generation.

For Further information please refer to documentation at Eclipse Documentation.

EDIT:

The workaround would be to create a project in your workspace and then create a linked folder to the resources you want to scan that are somewhere else on the file system.

Lii
  • 11,553
  • 8
  • 64
  • 88
VAR121
  • 512
  • 2
  • 5
  • 16
  • Can you please elobarate your question – VAR121 Sep 24 '12 at 12:59
  • we have a function which for each resource in the navigator is getting an Id and if the resource does not have an Id It will go to report an error. We are getting problem sometimes when the method is trying to get the id for .project files. It is strange because it happens sometimes. I can write an If-statement to check if the file is not .project then report a problem. But I think the others maybe had the same problem and there is a better way! – Govan Sep 24 '12 at 14:15
  • 2
    Eclipse will regenerate those .project files for any project in its workspace, but not predictably (at least not to me) – Paul Webster Sep 24 '12 at 14:37
2

Don't try to delete the project meta data. That will lead to more trouble afterwards than simply configuring the team API to ignore the .project files during all version control operations. That .project file contains meta information from all plugins, not only from yours.

Depending on the VCS used, you should just create a default .gitignore, svn:ignore, or whatever you need.

Besides that, I would simply call it a bug in your plugin that it tries to do something with that file. It simply should not do that. Other plugins will create other files in the projects and you should not try to handle each and every file, if they don't belong to your plugin. The JDT plugin also knows which files to compile and which to ignore.

Bananeweizen
  • 21,797
  • 8
  • 68
  • 88