如何设置Maven原型以生成与父项目相同级别的模块项目?
我想创建一个maven原型,它应该在与父项目相同的级别上生成子模块项目。所以这个结构看起来像-如何设置Maven原型以生成与父项目相同级别的模块项目?,maven,maven-archetype,Maven,Maven Archetype,我想创建一个maven原型,它应该在与父项目相同的级别上生成子模块项目。所以这个结构看起来像- - parent |_ pom.xml |_ <rest-of-the-files> - child1 |_ pom.xml |_ <rest-of-the-files> - child2 |_ pom.xml |_ <rest-of-the-files> -父级 |_pom.xml |_ -孩子1 |_pom.xml |_
- parent
|_ pom.xml
|_ <rest-of-the-files>
- child1
|_ pom.xml
|_ <rest-of-the-files>
- child2
|_ pom.xml
|_ <rest-of-the-files>
-父级
|_pom.xml
|_
-孩子1
|_pom.xml
|_
-孩子2
|_pom.xml
|_
父pom.xml将具有如下模块-
<modules>
<module>../child1</module>
<module>../child2</module>
</modules>
../child1
../child2
有没有办法做到这一点?请参阅:
原型插件似乎不支持多模块项目的平面布局
您可以使用以下(同意,有点麻烦)解决方法:
+- parent
+- pom.xml
+- ...
|
+- child1
| +- pom.xml
| +- ...
|
+- child2
+- pom.xml
+- ...
parent/src/main/resources
中创建另一个项目:
+- parent
+- pom.xml
+- ...
+- src
+- main
+- resources
+- pom.xml
与POM类似:
。。。
new/project/created/over/src/main/resources/move modules$mvn initialize
家长POM中调整
s:
../child1
../child2
+- parent
+- pom.xml
+- ...
|
+- child1
| +- pom.xml
| +- ...
|
+- child2
+- pom.xml
+- ...
parent/src/main/resources
中创建另一个项目:
+- parent
+- pom.xml
+- ...
+- src
+- main
+- resources
+- pom.xml
与POM类似:
。。。
new/project/created/over/src/main/resources/move modules$mvn initialize
家长POM中调整
s:
../child1
../child2