Hi
I am trying to create a multi-modules project in eclipse with m2eclipse. I followed some tutorials but the way it work is not what i expect:
Here is the structure of my project
-Root
- webapps
- module1
- module2
I have pom.xml for Root and modules. (module 1 and 2 are independent to each other)
In the pom.xml (Root), i have
<modules>
<module>./webapps/module1</module>
<module>./webapps/module2</module>
</modules>
In module1’s pom.xml:
<parent>
<groupId>{RootGroupId}</groupId>
<artifactId>{RootArtifactId}</artifactId>
<version>{RootVersionId}</version>
<relativePath>../../pom.xml</relativePath>
</parent>
In module2, it is similar to module 1.
When I go to Root and run the pom file, it will trigger the Root’s phases first and the module’s phases later (build the root project and also build the module projects). To me it is fine.
But the problem happens when i go to module1 and run the pom.xml. Then it also so do the same: trigger the Root pom.xml and module1’s pom.xml. i dont like this. What i want to be happened is ONLY the module1's pom file is triggered (ONLY module1 is built), root’s pom will not be triggered (Root project is not be built).
Any help, please.
Update: If you don’t want a plugin configuration to be applied in POMs which inherit from the POM where it is declared, set
inheritedtofalse.Reference
I tried to reproduce the problem… but didn’t succeed. I created a similar project structure:
$ tree . . ├── pom.xml └── webapps ├── module1 │ ├── pom.xml │ └── src │ └── main │ └── webapp │ ├── index.jsp │ └── WEB-INF │ └── web.xml └── module2 ├── pom.xml └── src └── main ├── resources └── webapp ├── index.jsp └── WEB-INF └── web.xmlWhere the parent pom.xml declares:
And each child:
Building from the root triggers a reactor build:
But building a child doesn’t trigger anything on the parent:
Everything works as expected for me.
(initial answer removed as it appeared I misinterpreted the question)