michael nesterenko
michael nesterenko

Reputation: 14439

eclipse project properties

I am setting properties for IResource (IProject to be more specific) through IResource.setPersistenceProeprty. In this case property value is saved in .metadata folder. That is not so good as property is disconnected from .project file.

How can I save project property in .project file?

Upvotes: 1

Views: 5148

Answers (2)

Martti Käärik
Martti Käärik

Reputation: 3621

A common solution is to use project scoped preferences that are stored in a file located inside the project (in <project>/.settings folder).

ProjectScope ps = new ProjectScope(projectResource);
IEclipsePreferences prefs = ps.getNode("my.plugin.id");
prefs.put("key", "value");
prefs.flush();

Upvotes: 5

Related Questions