如何管理非托管 Eclipse 格式化配置文件?
我们的项目有一个“非托管配置文件”和节省时间的自动格式化。我希望能够修改此非托管配置文件的设置,并能够将它们重新签入版本控制。
Eclipse 的帮助文档非常没有帮助(“您不允许更改这样的配置文件,只有配置文件的创建者(管理员)可以更改它。”)。
Our project has an "Unmanaged profile" and save-time autoformatting. I'd like to be able to modify the settings for this unmanaged profile and be able to check them back in to version control.
Eclipse's help documents are quite unhelpful ("You are not allowed to change such a profile, only the creator (manager) of the profile can change it.").
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不确定这是否允许您将您的配置文件重新签入版本控制,但以下过程将允许您在任何已签出源的计算机上编辑您的配置文件。
要编辑您的配置文件,您必须在 Eclipse 中重新创建配置文件,您可以轻松地执行以下操作:
这将允许您重新创建配置文件,并允许您像平常一样在 Eclipse 中修改它。
注意:此过程适用于 Eclipse Indigo
I'm not sure if this will allow you to check your profile back in to version control, but the following process will allow you to edit your profile on any computer that has the source checked out.
To edit your profile, you have to recreate the profile in Eclipse, which you can easily do as follows:
This will let you recreate the profile, and allow you to modify it in Eclipse, as normal.
Note: This process works with Eclipse Indigo
问题是托管配置文件实际上存储在您的工作区而不是您的项目中。当您进行项目特定更改(例如选择不同的配置文件)时,设置将被推送到您的项目中。但项目中的设置与配置文件(工作区)中的设置格式不同。
目前 eclipse 不具备反向执行此操作的能力。也就是说,它无法从项目文件夹中获取设置来在工作区中创建配置文件。实际上,“非托管配置文件”是您丢失了源代码的配置文件。
我发现对配置文件进行逆向工程的最简单方法是生成一个可以导入的 XML 配置文件(在格式化程序设置 --> 导入按钮下)。
对项目的设置进行逆向工程;我写了下面的程序。它从项目文件夹中读取设置并将其作为 XML 文件写出:
The problem is that a managed profile is actually stored in your workspace not your project. Settings are pushed into your project when you make project specific changes such as selecting a different profile. But the settings in the project are a different format to those in in the profile (in the workspace).
At present eclipse does not have the ability to perform this in reverse. That is it can't take settings from your project folder to create a profile in the workspace. Effectively an "Unmanaged Profile" is a profile to which you have lost the source code.
The simplest way I've found to reverse-engineer the profile is to generate an XML profile file that can be imported (under the formatter settings --> import button).
To reverse-engineer the the settings from a project; I wrote the following program. It reads the settings from a project folder and writes them out as an XML file:
当您有非托管配置文件时,Eclipse 应该在您的项目目录中放置一个 .settings 文件夹。到目前为止,我发现更改设置的唯一方法是进入项目内的 .settings 文件夹并手动编辑其中的 .prefs 文件。
Eclipse should put a .settings folder in your project dir when you have an unmanaged profile. The only way I've found to change the settings so far is to go into the .settings folder within the project and hand edit the .prefs files in there.