3
votes

I have a remote Mercurial repository containing Maven projects. I would like to clone it into my Eclipse workspace for development.

I currently have Maven Integration for Eclipse installed through Eclipse Marketplace. I also have MercurialEclipse. But I can't checkout the code as Maven projects. When I checkout normally, only the parent project code is fully downloaded which makes sense because the Maven nature is not identified.

I have svn integrated fine, and I have the plugin "Maven SCM Handler for Subclipse" so I can easily checkout the projects from svn as Maven projects. Is there something like this for Mercurial?

Also I checked "File->New->Other->Maven->Checkout Maven Projects from SCM", and I see only svn in the dropdown.

Please let me know if the Maven-Mercurial integration in eclipse is possible.

Thanks for looking into this.

3

3 Answers

2
votes

I do that every day at work and there is a small trick for it.

Try to do it in this order:

  1. clone the project from command line
  2. then in eclipse import the project as a maven project
  3. then right click on the project and select team->share->mercurial
  4. follow the dialog boxes and eventually you will get to the one asking you the url of the scm.

And that's it. For multiple module project, you might have to repeat steps 3 and 4 for each of them.

For info i am using the version 1.2.0 of the maven plugin and for the mercurial one i use the one from the new website: https://bitbucket.org/mercurialeclipse/main/wiki/Home

and configured with an external mercurial client.

1
votes

You can clone and configure a multiple module project using MercurialEclipse and Maven plugins from Eclipse IDE performing the following steps.

  1. Clone the project in Eclipse IDE using MercurialEclipse.
  2. Right click on the cloned project in the Project Explorer, select "Configure" and then "Convert to Maven Project".
  3. Select File, Import and "Existing Maven Project" and click Next. You will get your cloned project and modules automatically selected on the next screen, so just need to click Finish button.

Finally, you will get your multi module project cloned and configured as maven project.

0
votes

I use MercurialEclipse plugin and do Checkout in other way:

  1. Clone repository
    1. File -> New -> Project...
    2. Select Mercurial -> Clone Existing Mercurial Repository Next >
    3. Type URL, Auth data, and Clone directory name (optional) Finish
  2. Prepare project for Eclipse
    1. Generate Eclipse files: execute mvn eclipse:eclipse in command line
    2. Refresh project (via context menu or F5)
    3. Sometimes in the end you need to select the right encoding:
      1. Open Project properties
      2. Set Resource -> Text file encoding to Other