Setting up a project using Eclipse and Mercurial

I would like some advice on setting up a multi-project workspace using Eclipse. In other words, I intend to create some kind of application that will use two or more projects for its final assembly. Projects will be stored in some version control system. This is pretty easy to do.

The tip I'm looking for is how I should set up version control or the Eclipse workspace to make it easier to set up a new developer / new machine. Ideally, a new developer or a developer on a new machine just issues one command (to something: it could be Eclipse, a version control system, some build system, or even a script); this command will create an environment from which code can be created.

I will use Java for the language and Mercurial for version control, if that matters for the solution. I am open to using the build system, although I have almost no acquaintance with any of them.

In fact, I hope to learn

  • where projects should be stored in the repository
  • how Eclipse should import or otherwise discover projects
  • how to initiate the above detection

* In this case, the new computer means a machine with the necessary applications (for example, Eclipse and TortoiseHg), but without code checks or any workspaces

+6
java version-control eclipse
source share
3 answers

Each installation of Eclipse will have to install the MercurialEclipse plugin, which can be installed through "Install New Software ..." by pointing it to the following URL: http://cbes.javaforge.com/update

Abstracts are the steps that I usually use when setting up a new application:

  • Setting up my projects in Eclipse
  • Go to the command line, create an hg repository, and then move my projects to the folder containing the repository.
  • Remove bin directories (so that they do not fall into Mercurial)
  • Change the "hg add" to the root of your Mercurial repository.
  • In Eclipse, delete your projects (do not click "Delete project contents on disk" or you will receive an error message)
  • From the File menu, select import. Select Existing Projects in Workspace in the General folder.
  • Select the "Browse ..." button next to "Select the root directory" and select your root folder for your repository.
  • Click Select All in the import dialog box and click Finish.
  • Open the navigator view (so you can see folders with folders), right-click on the bin directory in one project, go to "Command" and "Ignore ...". Select "Only this folder (" bin ") and click" OK. "
  • Select all projects, right-click, select "Team" and select "Commit"

At this point, your workspace is fully connected to the local Mercurial repository, and all of your folder structures are configured correctly.

When you are ready to share this with someone else, you will move your repository to a shared folder. In another Eclipse environment (possibly 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 that just appeared, click the "Create Repository ..." button. It looks like a compilation of commands with the words HG and the plus sign. Put in your shared repository URL and any authentication information, if necessary. Right-click the newly created repository and click "Clone Repository." That's all. All Eclipse preferences are derived from Mercurial, and everything is configured for the second developer.

It may sound like a lot of steps, but I can do it in less than two minutes when I practiced it several times.

+8
source share

I recommend using Maven as your build system:

  • integrates well with eclipse
  • Eclipse Independent
  • scriptable / can be called from a continuous integration server

Create somewhere the main-golden mercury storage and add the multi-module POM directly at the root level. Developers can then clone this repository and invoke "mvn clean install" at the root level to create everything.

Create a subfolder for each subproject. You can nest them as deep as you need.

+1
source share

MercurialEclipse is currently hosted at this address: https://bitbucket.org/mercurialeclipse/main/

Refresh site : http://mercurialeclipse.eclipselabs.org.codespot.com/hg.wiki/update_site/stable

via fooobar.com/questions/34082 / ...

0
source share

All Articles