1
votes

I'm working on writing a script that will checkout multiple Maven projects that all have modules. I want to import all the modules into Eclipse Mars as M2E projects. Now I've scoured other questions and answers about this and only see Eclipse CDT based solutions (eclipse.exe -base workspace -importAll {someURI}). However this doesn't convert your projects into M2E projects in eclipse. They are just plain-Jane java projects.

Does anyone know how I can, from a Windows Batch Script, import Maven projects as M2E faceted projects in Eclipse Mars?

I'm using Eclipse Mars.1, Java 7, Maven 3.3.

ADDED: Ultimately what I really want is a reliable way to build up a complex workspace of M2E projects. There are hierarchical dependencies between them so if it's not done right it's very confusing for more Junior developers.

1
Maybe there is a better way to share/manager complex workspaces? Using command line tools isn't the only option. I also looked into exporting a project set file (*.psf). The problem I see there is that the projects loose the M2E configuration.The Doctor 'X'
Are those Maven project correctly organised as a hierarchical directory structure? Is this a single project which is released at the same time? Is it stored in the same version control repository which means can you checkout it via single command (either via git clone or a single svn checkout URL...) ? Are you stuck with the Eclipse Release ?khmarbaise

1 Answers

1
votes

You can try to use:

mvn eclipse:eclipse

This will generate eclipse configuration files, after of that you can import into eclipse:

eclipse.exe -base workspace -importAll {someURI}