Reputation: 14439
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
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
Reputation: 9295
The eclipse .project content is exposed through IProjectDescription interface.
IProjectDescription description = IProject.getDescription()
Please read:-
Upvotes: 1