FabianB
FabianB

Reputation: 273

Eclipse: When to use .project file vs .settings folder?

When developing an Eclipse Plugin, when should I save project specific information in the .project file and when should I use project-scoped preferences that are saved in the .settings folder?

Upvotes: 2

Views: 217

Answers (1)

Chris Gerken
Chris Gerken

Reputation: 16392

The .project file is used only to store specific information (e.g. builders and natures) that is of interest to Eclipse. If you have settings that are specific to your tool and to a particular project, then you can store that info in the .settings folder.

To round that out, if you have general settings information you should create a preferences page and use that mechanism to persist the settings.

If you have some other information or program state then use the state location Eclipse provides for you. Of course, if any of that info is project specific, you should look at storing it in the project itself.

One more consideration, many version control plugins by default ignore files and folders whose names start with a dot (e.g. .project and .classpath). If the data you're storing must be kept with the project then you should consider using a resource name that does not start with a dot.

Upvotes: 2

Related Questions