Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple versions of the same multi-modules maven project under eclipse

I'd like to work on two different versions of the same multi-modules maven project under eclipse.

Unfortunately, when you import a multi-module maven project under eclipse, you can change the parent module project name yourself, to prevent conflicts, but not the child modules projects names. Child modules are imported as root projects, named after the module name. Apparently there is no way to rename them during import.

In an ideal scenario, I'd like to keep the pom as it is. Obviously I'd like to keep the same eclipse workspace...

like image 594
Laurent Grégoire Avatar asked May 04 '12 08:05

Laurent Grégoire


People also ask

How do I open multiple modules in eclipse?

To add modules, select eclipse-multi project in the Project Explorer and right click to open context menu. From the context menu, open Maven Project Wizard with New → Others → Maven and select Maven Module and click Next.

How do I run a multi module project in Maven?

A multi-module project is built from an aggregator POM that manages a group of submodules. In most cases, the aggregator is located in the project's root directory and must have packaging of type pom. The submodules are regular Maven projects, and they can be built separately or through the aggregator POM.

Can two Maven modules depend on each other?

Because modules within a multi-module build can depend on each other, it is important that the reactor sorts all the projects in a way that guarantees any project is built before it is required. The following relationships are honoured when sorting projects: a project dependency on another module in the build.


1 Answers

Yes, you can. You have to change the name pattern in the m2eclipse importer. All modules will have this pattern and you have a conflict-free env.

like image 119
Michael-O Avatar answered Sep 23 '22 18:09

Michael-O