使用 Eclipse 和 Mercurial 进行项目设置
我想要一些关于使用 Eclipse 设置多项目工作区的建议。换句话说,我打算创建一些应用程序,该应用程序将使用两个或更多项目进行最终构建。这些项目将存储在一些版本控制系统中。这很容易做到。
我正在寻求的建议是我应该如何设置版本控制或 Eclipse 工作区,以使设置新开发人员/新机器*变得非常简单。理想情况下,新开发人员或新机器上的开发人员只需发出一个命令(对某物:可以是 Eclipse、版本控制系统、某些构建系统,甚至是脚本);该命令将设置一个可以构建代码的环境。
如果这对解决方案很重要,我将使用 Java 作为语言,使用 Mercurial 进行版本控制。我愿意使用构建系统,尽管我对它们中的任何一个几乎都不熟悉。
本质上,我希望了解
- 项目应存储在存储库中的位置
- ,Eclipse 应如何导入或以其他方式发现项目,
- 如何启动上述发现
*在这种情况下,新机器意味着具有必要应用程序的机器(例如Eclipse 和 TortoiseHg),但无需签出代码或任何工作区
I would like some advice on setting up a multi-project workspace using Eclipse. In other words, I intend to create some application which will use two or more projects for its final build. The projects will be stored in some version control system. This is pretty easy to do.
The advice I am seeking is how I should set up the version control or Eclipse workspace to make setting up a new developer/new machine* very simple. Ideally, that new developer or developer on a new machine would simply issue one command (to something: it could be Eclipse, the version control system, some build system, or even a script); that command will set up an environment from which it would be possible to build the code.
I will use Java for a language and Mercurial for version control, if that matters for a solution. I am open to using a build system, although I have no almost no familiarity with any of them.
Essentially, I am to hoping to learn
- where the projects should be stored in the repository
- how Eclipse should import or otherwise discover the projects
- how to initiate the discovery mentioned above
*In this case, a new machine means a machine with necessary applications (such as Eclipse and TortoiseHg) but without checkouts of the code or any workspaces
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
每个 Eclipse 安装都需要安装 MercurialEclipse 插件,可以通过“安装新软件...”将其指向以下 URL 进行安装: http://cbes.javaforge.com/update
这些是我在设置新应用程序时通常使用的步骤:
此时,您的工作区已完全连接到本地 Mercurial 存储库,并且所有文件夹结构均已正确设置。
当您准备好与其他人共享时,您可以将存储库推送到共享位置。在另一个 Eclipse 环境中(可能在另一台计算机上)转到“Window”菜单并选择“Show View”和“Other...”。在 Mercurial 文件夹中选择“Mercurial Repositories”,然后单击“确定”。在刚刚出现的 Mercurial Repositories 视图中,单击“Create Repository...”按钮。它看起来像一个团队存储库,上面有 HG 和一个加号。输入您的共享存储库 URL 和任何身份验证信息(如果需要)。右键单击刚刚创建的存储库,然后单击“克隆存储库”。就是这样。所有 Eclipse 设置都是从 Mercurial 中提取的,并且一切都是为第二个开发人员设置的。
这听起来可能有很多步骤,但由于我已经练习了几次,所以我可以在不到两分钟的时间内完成此操作。
Each Eclipse installation will need to install the MercurialEclipse plugin which can be installed through 'Install New Software...' by pointing it at the following URL: http://cbes.javaforge.com/update
Theses are the steps I usually use when setting up a new application:
At this point your workspace is completely connected to a local Mercurial repository and all your folder structures are set up correctly.
When you are ready to share this with someone else you push your repository to a shared location. In another Eclipse environment (probably on another computer) Go to the 'Window' menu and select 'Show View' and 'Other...'. In the Mercurial folder select 'Mercurial Repositories' and click 'OK'. In the Mercurial Repositories view which just showed up click the 'Create Repository...' button. It looks like a team repository with the words HG and a plus sign. Put in your shared repository URL and any authentication information if needed. Right click on the repository just created and click 'Clone Repository'. That is it. All of the Eclipse setup is pulled from Mercurial and everything is set up for the second developer.
This may sound like a lot of steps but I am able to do this in less than two minutes now that I have practiced doing it a few times.
我建议使用 Maven 作为您的构建系统:
某个地方创建一个“main-golden”mercurial 存储库,并直接在根级别添加多模块 POM。然后,开发人员可以克隆此存储库并在根级别调用“mvn clean install”来构建所有内容。
为每个子项目创建一个子文件夹。您可以根据需要将它们嵌套得有多深。
I recommend to use Maven as your build system:
Create somewhere a "main-golden" mercurial repository and add the multi-module POM directly at the root level. Developers then can clone this repository and call "mvn clean install" at the root level to build everything.
Create a subfolder for every subproject. You can nest them as deep as you need.
MercurialEclipse 目前托管在以下地址: https://bitbucket.org/mercurialeclipse/main/
更新网站:
http://mercurialeclipse.eclipselabs.org.codespot.com/hg。 wiki/update_site/stable
通过 https://stackoverflow.com/a/2091928/916586
MercurialEclipse is currently being hosted at this address: https://bitbucket.org/mercurialeclipse/main/
Update site:
http://mercurialeclipse.eclipselabs.org.codespot.com/hg.wiki/update_site/stable
via https://stackoverflow.com/a/2091928/916586