模块项目上的maven模块

时间:2017-10-15 17:37:37

标签: maven module

模块maven项目的模块可以拥有自己的模块吗?你怎么写中间模块pom? (这里是例子的pom) 有些想法:

父:

- > plugin1

- > - >的pom.xml

- > plugin2

- > - >的pom.xml

- &GT; pom.xml:<modules><module>plugin1</module><module>plugin2</module><module>examples</module> </modules>

- &GT;实例

- &GT; - &GT;示例plugin1

- &GT; - &GT; - &GT;的pom.xml

- &GT; - &GT;示例plugin2

- &GT; - &GT; - &GT;的pom.xml

- &GT; - &GT;示例插件1&amp; 2

- &GT; - &GT;的pom.xml     <modules><module>example plugin1</module><module>exampleplugin2</module><module>example plugin1 &2</module> </modules>

1 个答案:

答案 0 :(得分:1)

任何带有模块的项目(在您的情况下为父项和示例)必须是包装类型pom,并且可以定义零个,一个或多个模块。

<packaging>pom</packaging>

<modules>
  <module>example-plugin1</module>
  <module>example-plugin2</module>
</modules>

查看Github上的Camunda BPM Platform project。 它还有一个父项目,在本例中是存储库根目录下的BPM platform Pom。如果你看一下这个pom,你会看到一个名为 engine-plugins 的模块。模块本身是几个模块的父级(在本例中为Camunda BPM插件)。因此包装类型 pom 。请参阅以下pom.xml,因为它与您的示例非常相似:https://github.com/camunda/camunda-bpm-platform/tree/master/engine-plugins