Community
Participate
Working Groups
Build Identifier: 20100917-0705 I have successfully imported a multi-module maven project which has just the parent-pom and a single module in it. When I add a new maven module to the the parent pom, it creates the new module, but corrupts the parent POM. It almost empties the parent POM while trying to add the new module to the list of modules. Reproducible: Always Steps to Reproduce: Unzip the attached test case in /tmp. 1. Import /tmp/m2e_bug/ into Eclipse as a maven project from existing sources. 2. Select parent-pom, add a new maven module type project to it. Give it some name. 3. Choose "webapp-javaee6" as the artifactId in the archetype selection panel. Leave everything else as default. Finish creating the module. 4. Now, you will see parent-pom getting almost emptied as shown below: <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <modules> <module>foo</module> </modules> </project>
Created attachment 187384 [details] Test case.
the workaround is surprisingly to keep the parent-pom editor opened when creating the module.
I've rewritten the entire handling of <modules> section in the pom editor to use the DOM tree operations (based on SSE XML stuff) rather than the EMF model from maven.edit. It seemed to fix the issue. the disturbing part is that I was not able to figure out what actually removed the file content. My guess is that's some sort of model synchronization issues..
.
Moved to https://github.com/eclipse-m2e/m2e-core/issues/