如何自动配置 Eclipse?
从事项目的团队往往需要 Eclipse 的通用配置。这包括通用配置和项目特定配置。例如,一般来说,每个人都可能希望共享缩进、某些插件的安装(例如 m2eclipse、testng、egit、Spring 支持)。此外,对于一个项目,您可能需要特定的插件配置(例如,对于 m2eclipse,设置自定义 Maven 设置文件,为 eclipse 构建事件配置额外的 Maven 目标),或自定义 Eclipse 目标平台,甚至只是为了设置- 某些自定义启动器。
目前,我的团队执行一系列手动步骤来尝试正确配置所有内容。对于新开发人员来说,这很乏味、容易出错并且难以遵循。说明也往往会过时。
这种配置可以在多大程度上实现自动化?应该怎么做呢?
A team working on a project will tend to need a common configuration of Eclipse. This includes general configuration and project specific configuration. For example, generally, everyone might wish to share indentation, installation of certain plugins (say m2eclipse, testng, egit, Spring support). Further, for a project, you might want specific plug-in configurations (e.g., for m2eclipse, setting up a custom Maven settings file, configuring extra Maven targets for eclipse build events), or a custom Eclipse target platform, or even just to set-up certain custom launchers.
Currently, my team executes a series of manual steps to try and get everything configured correctly. This is tedious, error-prone and difficult for new developers to follow. Instructions also tend to get out-dated.
To what extent can this sort of configuration be automated? How should it be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
无需修改的最简单的方法是拥有一个通用的首选项文件(导出->常规->首选项),每个人都可以加载该文件。在现有的相同 Java 安装下效果最佳。
这些天可以添加插件,但我还没有使用过它。此外,根据您想要的所有插件,使用默认包创建本地存储库可能会有所帮助。然后你就可以安装它,它会拉入参考文献。本地缓存可能非常有用,因为某些存储库非常慢。
The simplest thing available without modifications is to have a common preferences file (Export->General->Preferences), which everybody can then load. Works the best with the same Java installations present.
It is possible to drop in plugins these days but I have not worked with it. Also it might be beneficial to create a local repository with a default package depending on all the plugins you want. Then you can just install that and it will pull in the references. A local cache might be very beneficial as some repositories are quite slow.
有多种共享 Eclipse 安装/配置和设置的解决方案。例如,Pulse(有免费版本)。如果你浏览 StackOverflow 中以前的问题,你会发现很多关于这些问题的讨论。
我建议不要复制配置和工作区文件夹。根据我的经验,它并不总是有效。另外,这种技术只能起作用一次。以后就不会同步了。
更新:我刚刚想起来还有另一个有用的插件可供查看:Google Workspace Mechanic。
There are several solutions for sharing Eclipse Installation/Configuration and settings. For example, Pulse (has a free version). If you browse previous questions in StackOverflow, you will find many discussions regarding these issues.
I would suggest against copying the configuration and workspace folders. From my experience, it won't always work. Plus, this technique only works once. It doesn't sync later.
Update: I just recalled that there's another useful plugin to checkout: Google Workspace Mechanic.
在一个工作站上配置 Eclipse,然后为其创建一个 zip 文件或 rar 文件并将其传递给其他人..这将有所帮助,否则您也可以编写 cmd 脚本将插件和其他有用的东西复制到相同的文件中会更不容易出错。
configure the eclipse at one workstation and then make a zip file or rar file for the same and pass it to others.. that will help and otherwise you can also write cmd scripts to copy the plugins and other useful stuff in to the same and these will be less error prone.
配置一次,然后复制配置文件夹。如果还不够,请复制整个 Eclipse 文件夹。
Configure it once and then make copies of the configuration folder. If its not enough, copy the entire Eclipse folder.
我同意“Thorbjørn Ravn Andersen”,但是首选项导出不会导出所有首选项,尤其是来自附加插件的首选项。您还应该压缩一个工作 Eclipse 并将其提供给所有团队成员。
i agree with "Thorbjørn Ravn Andersen" but the preferences export doesn't export all preferences, especially from additonal plugins. you should additionally als zip a working eclipse and provide it to all teammembers.
我认为不同的部分有不同的配置/共享方式。
安装
安装可以作为集中部署安装在nfs中,并由管理员维护。所有团队成员共享安装(eclipse等插件)。
插件偏好
某些功能的首选项可以导出为文件,然后导入到其他环境中。但这取决于插件的实现。例如,您可以导出/导入密钥设置和jre设置。
项目的具体设置
例如,java编译级别和代码格式设置存储在项目文件夹下的.pref配置文件中。您可以通过源代码控制工具来管理它们。因此这些设置可以在团队成员之间共享。
I think different parts have different ways to configure/share.
installation
The installation could be installed in the nfs as central deployment, and maintain by administrator. All team members share the installation(eclipse and other plug-ins).
plug-ins preference
The preferences of some feature could be exported a file, then imported in other environments. But it depends on the implementation of the plug-ins. For example, you can export/import key setting and jre setting.
project's specific settings
For example, the java compiler level and code format setting are stored .pref configuration file under the folder of project. You can manage them via source control tool. So those setting can share among team members.