要从 Subversion 存储库中排除哪些 Eclipse 文件
作为一个开发团队,我们总是对 subversion 和 eclipse 感到满意,我们检查了一切,一切都很好。直到我们雇用了一位新员工,他只使用 eclipse (RAD)。他的 RAD 签入目前正在污染 svn 存储库,阻止我们的 Eclipse 签出以完成构建。 一种解决方案可能是强行让新聘者窒息,另一种更微妙且可能更合适的方法是让我们的项目IDE变得不可知。 我希望学习一种快速可靠的解决方案,而不是通过反复试验来删除文件。
- 我已经 了解到我应该 删除文件并将其添加到 svn 全局忽略。我想知道有没有 扩大这个项目的方法 而不是让每个人都修复 他们自己的svn配置?要添加到根 .svn 目录中的内容吗?
- 我也是 寻找列表甚至脚本 删除 eclipse 文件并 svn 存储库中的目录 (.项目.设置.类路径?? .externalToolBuilders .springBeans) 无需冒以下风险 完全毁了工作空间。
- 我是 也有兴趣找到最快的 恢复工作空间的方法,如 我们使用 Maven 作为软件 项目管理我可以做mvn eclipse:eclipse 的根目录 工作区,但我如何找到 正确的 WST 设置是,在 eclipse 中恢复路径设置的最快方法是什么?
我认为很多人都会面临相同的用例,因此有相同的问题,但我还没有在谷歌上找到任何信息。希望这里有人能指出我正确的方向。
We as a development team were always happy with subversion and eclipse, we checked in everything and everything was fine. Until we had a new hire who's using anything but eclipse (RAD ). his RAD checkins are currently polluting the svn repo withholding our eclipse checkouts to finish building.
One solution may be to force eclipse in the new hirer's throat, another more subtle and probably more suitable approach is to make our project ide agnostic.
Instead of removing the files by trial and error I hope to learn a quick and reliable solution.
- I already learned that i should
remove files and add them to the svn
global ignore. I'm wondering is there
a way to make this project wide
instead of having everybody fixing
their own svn config? Something to add to your root .svn directory? - I'm also
looking for a list or even script to
remove the eclipse files and
directories from the svn repo
(.project .settings .classpath??
.externalToolBuilders .springBeans)
without running the risk of
completely ruining the workspace. - I'm
also intested in finding the quickest
way of restoring the workspace, as
we're using maven for software
project management I can do mvn
eclipse:eclipse in the root of
workspace but how do I find what the
proper WST settings are, and what is the quickest way or restoring your path settings in eclipse ?
I thought that many people would have been faced with the same use case, and consequently had the same questions but I haven't found anything on Google yet. Hopefully somebody here can point me in the right direction.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想要一个与语言无关的代码存储库,问题不在于要排除哪些文件,而在于要包含文件。意思是,在与语言无关的存储库中,实际上应该只有项目所需的文件:
你应该当然排除:
在 Eclipse 中,有一个“全局”忽略列表,其中包含以下文件:通过 SVN、CVS 等共享到存储库。您可以在这里找到它:
如果您正在寻找 Eclipse 之外的东西,请尝试本地 subversion 配置中的 global-ignores 配置。将其添加到您的 ~/.subversion/config 文件中。
请注意,如果从存储库中排除 Eclipse 配置,您将必须在签出后更具体地设置项目。
然而,正如您所说,您正在使用 Maven,这实际上不会给您带来太多问题。如果 Maven 项目的 pom.xml 文件配置正确且完整,您可以通过“导入为 Maven 项目”轻松地从 SVN 导入项目 - Eclipse 将在导入时为您完成所有正确的配置。 (为此,您需要 m2Eclipse Maven 插件,但我猜您已经在使用类似的东西了?无论如何,这里是链接:http://m2eclipse.sonatype.org/sites/m2e )
至于您关于清理存储库的脚本的问题:我不知道这样的事情现在,我会对此非常小心。听起来很多事情可能会变得非常糟糕。 ;)
最后但并非最不重要的一点是,恢复工作区:
根据我的经验,最简单的方法通常是在本地删除项目并重新签出“作为 Maven 项目”。这样 Eclipse 将重新配置所有重要的内容。我花了几个小时来处理损坏的 Eclipse 配置,有时它往往会卡住并且无法恢复 - 特别是如果您正在使用很多插件,而这些插件往往会发挥自己的配置魔力。 (而且碰巧并不完全没有错误......)
If you want to have a language-agnostic code repository the question is less about which files to exclude that about which files to include. Meaning, in a language-agnostic repo there should really only be the files necessary for the project:
You should certainly exclude:
In Eclipse there is a 'global' ignore list for files which are shared to repositories via SVN, CVS, etc. You can find it here:
If you're looking for something outside Eclipse, try the global-ignores config in your local subversion config. Add this to your ~/.subversion/config file.
Mind that if excluding the Eclipse config from the repos you'll have to set up your projects after a checkout more specifically.
However, as you say you're using Maven this should not pose too many problems for you actually. If the pom.xml files of maven projects are configured correctly and completely, you can easily import a project from SVN via 'Import as Maven Project' - Eclipse will do all the right config for you on the import. (For this you need the m2Eclipse Maven Plugin, but I guess you'll be using something like that already? Anyway, here's the link: http://m2eclipse.sonatype.org/sites/m2e )
As for your question concerning a script to clean the repo: I'm not aware of such a thing right now, and I'd be very careful with this. Sounds like a lotta things could go horribly wrong. ;)
Last but not least, restoring the workspace:
In my experience, it is often the easiest thing to just delete your project locally and to a fresh checkout 'as maven project'. This way Eclipse will reconfigure all the important stuff. I have spent hours on broken Eclipse config, sometimes it tends to just get stuck and fails to be able to recover - especially if you're working with a lot of plugins which tend to do some of their own configuration magic. (And happen to be not exactly bug free...)