Eclipse - Maven and Mercurial

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

I currently have Maven Integration for Eclipse installed via the Eclipse Marketplace. I also have MercurialEclipse. But I cannot validate the code as Maven projects. When I check ok, only the source code of the project is fully loaded, which makes sense because the nature of Maven is not identified.

I have svn integrated perfectly and I have the "Maven SCM Handler for Subclipse" plugin so I can easily check projects from svn as Maven projects. Is there something similar for Mercurial?

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

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

Thanks for looking at this.

+3


source to share


3 answers


I do this every day at work and there is a little trick for that.

Try it in the following order:

  • clone project from command line
  • then in eclipse import the project as maven project
  • then right click on the project and select command-> share-> mercurial
  • follow the dialogs and eventually you will be taken to whoever gives you the scm url.


What is it. For a project with multiple modules, you may need to repeat steps 3 and 4 for each of them.

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

and configured with an external mercurion client.

+2


source


You can clone and customize a multi-module project using MercurialEclipse and Maven plugins from the Eclipse IDE by following the steps below.

  • Clone the project in the Eclipse environment using MercurialEclipse.
  • Right-click the cloned project in the Project Explorer, select Configure and then Convert to Maven Project.
  • Select File, Import and Existing Maven Project and click Next. You will receive your cloned project and modules automatically selected on the next screen, so just click on the Finish button.


Finally, you will get the cloned and configured multi-module project as a maven project.

+1


source


I am using the MercurialEclipse plugin and doing Checkout in a different way:

  • Clone repository
    • File -> New -> Project ...
    • Select Mercurial -> Clone an Existing Mercurial Repository Next >
    • Enter URL, Auth details and Clone directory name (optional) Finish
  • Prepare a project for Eclipse
    • Generate Eclipse files: execute mvn eclipse:eclipse

      in command line
    • Refresh project (via the context menu or F5)
    • Sometimes at the end you need to choose the correct encoding:
      • Open project properties
      • Set resource -> Encoding text file for others
0


source