简体   繁体   English

如何为我的团队重新包装日食

[英]how to repackage eclipse for my team

I'd like to set up eclipse with a bunch of plugins and DB connection configurations, etc and re-zip it up so my team-mates and new starters can all be working on the same platform easily. 我想用一堆插件和数据库连接配置等设置eclipse并重新压缩它,这样我的队友和新的启动器都可以轻松地在同一个平台上工作。

It seems that installing plugins is fine, but when I add in custom jars (eg ivy2, ojdbc, etc) they all save with full, absolute paths which probably dont exist on others machines (particularly if they unzip in a different location to me). 似乎安装插件很好,但是当我添加自定义jar(例如ivy2,ojdbc等)时,它们都会保存完整的绝对路径,这些路径可能在其他机器上不存在(特别是如果它们在不同的位置解压缩到我这里) 。

Anyway, I'm hoping that this idea is not silly and am working if this sort of process is documented somewhere or if anyone has any tips in general. 无论如何,我希望这个想法不是愚蠢的,如果在某个地方记录这种过程,或者如果有人有任何一般的提示,我正在工作。

Thanks, 谢谢,

I would recommend against requiring all developers to place eclipse in the same location. 我建议不要求所有开发人员将eclipse放在同一个位置。 There are times when some developers may want to try an alternate version of eclipse to explore a technology that requires a different set of plugins or a different eclipse base version. 有些开发人员可能想尝试替代版本的eclipse来探索需要不同插件集或不同eclipse基本版本的技术。

Let developers install eclipse where they would like. 让开发人员在他们想要的地方安装eclipse。

However, for jars that you need to run plugins (external dependencies that you need to configure for proper plugin usage): 但是,对于需要运行插件的jar(需要配置正确插件使用的外部依赖项):

Hardwire a directory for those jars (as opposed to the entire eclipse dir), like c:\\eclipse-helpers or something. 硬连线那些罐子的目录(而不是整个eclipse目录),比如c:\\ eclipse-helpers或者其他东西。


To deal with third-party library dependencies (in the code you're developing), you have a few good choices: 要处理第三方库依赖项(在您正在开发的代码中),您有几个不错的选择:

  1. Create project(s) to hold the third-party libs and check them into your source version control system (which you are using, right?). 创建项目来保存第三方库并将它们检入您的源版本控制系统(您正在使用它,对吗?)。 You can then add the libs to the build path(s) of the project(s) - make sure you mark them for export in the "order and export" tab of the build path page. 然后,您可以将libs添加到项目的构建路径中 - 确保在构建路径页面的“order and export”选项卡中将它们标记为导出。 You can then simply add these third-party projects as project dependencies. 然后,您可以简单地将这些第三方项目添加为项目依赖项。

  2. Reference the third-party jars as CLASSPATH variables when adding them to the build path of your projects. 将第三方jar添加到项目的构建路径时,将它们引用为CLASSPATH 变量 This allows other developers to store the dependencies in different locations. 这允许其他开发人员将依赖项存储在不同的位置。 Perhaps define a CLASSPATH variable (in eclipse's Window->Preferences->Java->Build Path->Classpath Variables) called THIRD_PARTY_JARS; 也许定义一个名为THIRD_PARTY_JARS的CLASSPATH变量(在eclipse的Window-> Preferences-> Java-> Build Path-> Classpath Variables中); each developer can map it to a different path where they want to hold their deps. 每个开发人员都可以将其映射到他们想要持有他们deps的不同路径。

  3. Reference the third-party jars as a "user library" (Window->Preferences->Java->Build Path->User library). 将第三方jar引用为“用户库”(Window-> Preferences-> Java-> Build Path-> User library)。 This is similar to classpath variables, but acts as an explicit set of jars. 这与类路径变量类似,但充当一组显式的jar。

  4. Include the third-party jars directly in your projects. 在项目中直接包含第三方罐子。 Use this option only if you need the deps in a single location. 仅在需要单个位置的deps时才使用此选项。

Although not exactly in line with the direction of the question, you could use Yoxos OnDemand . 虽然不完全符合问题的方向,但您可以使用Yoxos OnDemand It allows you to "roll-your-own" Eclipse distro and download it as a zip. 它允许您“自己动手”Eclipse发行版并将其下载为zip。 They add in their own perspective where you can add more plugins (direct from their repo), or update the plugins that you have. 他们以自己的视角添加可以添加更多插件(直接来自他们的仓库)或更新您拥有的插件。

Although I've never used the feature, you can make make your own stacks and name them, allowing anyone to go to the site later and download it (with the most up-to-date versions of the plugins). 虽然我从未使用过该功能,但您可以制作自己的堆栈并命名它们,允许任何人以后访问该站点并下载它(使用最新版本的插件)。 Also, dependencies for plugins are resolved automatically if need be. 此外,如果需要,还会自动解决插件的依赖关系。

In eclipse - in many places it's possible to use workspace relative paths or system environment infos to reference external files, too. 在eclipse中 - 在很多地方,也可以使用工作空间相对路径或系统环境信息来引用外部文件。 Another option could be to place your jars into a workspace project so that every team member can check it out from cvs/subversion/whatever and start working. 另一种选择可能是将您的罐子放入工作区项目中,这样每个团队成员都可以从cvs / subversion /中查看它并开始工作。 Working like this ensures a reproducible environment for server builds or for desktops even after years. 这样工作可确保服务器构建或桌面的可重现环境,即使在多年后也是如此。

Talking about Yoxos... it provides "Workspace Provisioning" as well. 谈论Yoxos ......它也提供了“Workspace Provisioning”。 This means you can attach Eclipse Preferences, checkstyle configurations and Mylyn setups additionally to your list of needed tools/plugins for your IDE to your yoxos profile. 这意味着您可以将Eclipse首选项,checkstyle配置和Mylyn设置附加到IDE所需的工具/插件列表中,以及yoxos配置文件。 This means your team could share a profile and would be able to start working with the same setup regardless of their OS or whatever. 这意味着您的团队可以共享一个配置文件,并且能够开始使用相同的设置,无论他们的操作系统或其他什么。 (Its possible to use multiple profiles at once, too.) (也可以同时使用多个配置文件。)

We did a similar thing with our development environment (it needed both Eclipse and our own plug-in which, in the early stages, had to run in a known location). 我们在开发环境中做了类似的事情(它需要Eclipse和我们自己的插件,在早期阶段,它必须在已知的位置运行)。

We just put it in c:\\eclipse_<projName> and made that a requirement for the team. 我们只是将它放在c:\\eclipse_<projName>并使其成为团队的一项要求。 That's probably the easiest solution for you. 这对您来说可能是最简单的解决方案。

It's your team, you can dictate this as a requirement. 这是你的团队,你可以根据要求来决定。 Unless your team members are absolute idiots, they'll work with you. 除非您的团队成员是绝对白痴,否则他们会与您合作。

I found Yoxos really good and it does very good work in determining dependencies. 我发现Yoxos非常好,它在确定依赖关系方面做得很好。 Its really a good tool and worth giving a look. 它真的是一个很好的工具,值得一看。

I just started using git to manage my eclipse install. 我刚开始使用git来管理我的eclipse安装。 I did a write-up . 一篇文章 The approach might work for you, and it's probably worth looking at. 这种方法可能适合您,它可能值得一看。

If developers all don't have the same paths on their machine, instead of adding independent JAR files you could create what Eclipse calls a "library" and include a bunch of jars in that. 如果开发人员在他们的机器上没有相同的路径,而不是添加独立的JAR文件,您可以创建Eclipse称为“库”的内容,并在其中包含一堆罐子。 Then another developer just has to change the location of the library and it'll pick up all the jars in there. 然后另一个开发人员只需要改变库的位置,它就会拿起那里的所有罐子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM