【发布时间】:2011-04-17 00:00:42
【问题描述】:
嗨 我正在尝试使用 m2eclipse 在 eclipse 中创建一个多模块项目。我遵循了一些教程,但它的工作方式不是我所期望的:
这是我项目的结构
-Root
- webapps
- module1
- module2
我有用于 Root 和模块的 pom.xml。 (模块 1 和模块 2 相互独立) 在 pom.xml (Root) 中,我有
<modules>
<module>./webapps/module1</module>
<module>./webapps/module2</module>
</modules>
在module1的pom.xml中:
<parent>
<groupId>{RootGroupId}</groupId>
<artifactId>{RootArtifactId}</artifactId>
<version>{RootVersionId}</version>
<relativePath>../../pom.xml</relativePath>
</parent>
在module2中,与module 1类似。
当我转到 Root 并运行 pom 文件时,它将首先触发 Root 的阶段,然后触发模块的阶段(构建根项目并构建模块项目)。对我来说很好。
但是当我转到 module1 并运行 pom.xml 时,就会出现问题。然后它也这样做:触发 Root pom.xml 和 module1 的 pom.xml。我不喜欢这个。 What i want to be happened is ONLY the module1's pom file is triggered(只建module1),不会触发root的pom(不建root项目)。
请帮忙。
【问题讨论】:
-
你应该接受一些答案(在答案的投票计数器下方打勾)
标签: eclipse maven-2 project m2eclipse multi-module