在版本控制中存储持久资源属性 [英] Storing persistent resource properties in Version Control

查看:316
本文介绍了在版本控制中存储持久资源属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个插件,通过eclipse的持久性属性机制向项目的资源添加任意信息。现在这些项目存储在版本控制系统(如SVN和GIT)中。



持久化属性将不会被检入,因为它们存储在工作空间的元数据中,而不在内部项目本身。



%workspace%\.metadata\.plugins\org.eclipse.core.resources\.projects\\ \\%projectname%\.indexes




  • 有没有办法将这些属性保存到项目并管理他们通过版本控制?

  • 如果没有,有没有人尝试过这样的自定义解决方案?



这里有一个问题:



Eclipse:在.project文件中存储信息



如果要存储不涉及的项目范围信息,答案很有用单一资源。但是我需要将信息连接到文件夹和文件,并将这些信息存储在项目文件系统的位置。

解决方案

的资源在关键部分的项目范围偏好值。所以:

  preferences.putString(/ path / to / file / keyword,value); 


I have a plugin that adds arbitary information to resources of projects through the persistent property mechanism of eclipse. Now these projects are stored in version control systems like SVN and GIT.

The persistent properties will not get checked in because they are stored in the metadata of the workspace and not inside the project itsself.

%workspace%\.metadata\.plugins\org.eclipse.core.resources\.projects\%projectname%\.indexes

  • Is there a way to save these properties to the project and manage them via version control?
  • If not, does anyone have tried a custom solution for this?

There has been a question alike here:

Eclipse: Storing info in .project file

and the answer is useful if you want to store project scope information that does not refer to single resources. But i need to connect information to folders and files and store that information inside the projects filesystem location.

解决方案

You could include the path of the resource in the 'key' part of the project scope preference value. So:

preferences.putString("/path/to/file/keyword", value);

这篇关于在版本控制中存储持久资源属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆