Eclipse m2e multi-module checkout project and convert to maven

I recently needed to check the apache project to do some discovery / debugging attempts (specifically maven-surefire-plugin, see this question ). This, like most other apache projects, is a multi-module maven project. So, in eclipse, I open SVN Repositories browswer, add a new repository, find the project and right-click->Checkout.... In the wizard, click Checkout as a project in the workspaceand enter the name of the project.

I have a project, now I need to let eclipse know its maven project, therefore right-click->Configure->Convert to Maven Project. Now the parent project is the maven project. I can right-click->Run As->Maven Buildand it works. But all modules are just folders. Eclipse knows nothing about where the source code is or even if it is. In one module project, he automatically installed the source folder, build folder, and other configuration. Moreover, if you create a project with several modules from scratch, you start by creating a parent project, and then when you add modules to it, each of them is displayed as separate projects in eclipse with a physical directory living under the parent project if necessary the default for the maven build process.

So, knowing how this is done when creating new projects, I can File->New->Project...choose General->Projectto give the project a name (I map it to the name of the module), uncheck Use default locationand set Location:the path to the module inside the parent project folder. After clicking Finishand repeating the process for each other module, I have something similar to what I expect. Now I need to convert each individual module into a maven module in the same way as the parent project. Great, these are all maven projects, right?

So, I open them and the source folder is not installed.

Argh... , src right-click->Build Path->Use as Source Folder. , , ... , , , . .

: ? ? , Configure->Convert to Maven Project pom , , ? Apache, , ... - ?

+5
1

Eclipse, Maven (right-click -> Import... -> Existing Maven Projects) , , . right-click -> Team -> Share Project... .

+3

All Articles