Community
Participate
Working Groups
I have a multi-module project organized like this: /m0/pom.xml /m0/m1/pom.xml /m0/m2/pom.xml /m0/m3/pom.xml /m0/m3/m3.1/pom.xml When I try to import "Existing Maven Projects" using a "Name template", the template is used for all imported projects except for the root module's project. Instead, the name for the root module project is equal to the directory name in which it's contained, in this case "m0". I'm expecting the root project to conform to the selected name template. My environment: Eclipse Helios Service Release 1, 20100917-0705 M2E v0.12.1.20110112-1712
Using name template for the root project is not always possible. For example, when the root project is located right inside workspace root, Eclipse requires project name to match directory name. Also, it is generally recommended to have project directory name match project artifactId. http://www.sonatype.com/people/2011/01/maven-tip-project-directories-and-artifact-ids/ http://jira.codehaus.org/browse/MNG-5000
Igor, thanks for this info! I hadn't found this explanation elsewhere. As a follow-up question, what convention would you suggest I adopt when attempting to import independent copies of a given multi-module project within one Eclipse workspace (or perhaps this use case is inadvisable to begin with)? Here's one strategy: I reorganize my files to reflect: workspace/ workspace/.metadata/ -- the only concrete child of workspace/ projects/ projects/p1/copy1/m0/pom.xml projects/p1/copy2/m0/pom.xml Then, import Maven module projects using name templates to differentiate the copies.
Do these two projects have equal groupId, artifactId and version?
Yes, the two projects are in essence copies of one another and contain modules with equal groupId, artifactId and version.
I was wondering if we can (when we find duplicate names on import) have some simple way of resolving it without user interaction. Like add _2 to the name. That assumes that it's easy for the user afterwards to change the eclipse name without any other sideeffects (to the pom for example)
m2e does not support projects with same groupId/artifactId/version. even if we fix the import, workspace dependency resolution will be confused by this. we may reconsider if you can provide good usecase for this.
Igor, in this case perhaps the m2e import dialog should not only warn the user about project name collisions, but also collisions on groupId-artifactId-version id? I had assumed this use case would pose difficulties for m2e's workspace dependency resolution, but generally I try to keep only one project with a specific g-a-v id open at a time to avoid confusion. Because my workspace configuration is somewhat complex (lots of imported, interdependent maven projects--workspace dependency resolution is great!), I try and maintain a single workspace and jump between copies of projects with matching g-a-v id's as needed, instead of maintaining multiple workspaces. Thanks for your input!
Moved to https://github.com/eclipse-m2e/m2e-core/issues/