[英]Configure SCM for flat multi-module maven project so that eclipse can checkout everything at once
I've been playing a lot with this and can't find a proper way to do it. 我一直在玩很多,但找不到合适的方法。 This is my setup: 这是我的设置:
/parent
pom.xml
<modules>
<module>../module-1</module>
...
<module>../module-n</module>
</modules>
<scm><connection>https://repo/trunk</connection>...</scm>
/module-1
pom.xml
...
/module-n
pom.xml
I was expecting eclipse to checkout all sub modules projects when I checkout the parent. 当我结账时,我期待eclipse检查所有子模块项目。 Is that possible in a flat project hierarchy? 这在平面项目层次结构中是否可行?
The give structure implies that your module-1 is on the same level as parent which does not make sense neither in Eclipse nor in Maven. 给定结构意味着你的module-1与父级处于同一级别,这在Eclipse和Maven中都没有意义。 The best is to structure the project like the following: 最好是按如下方式构建项目:
+-- parent (pom.xml)
+-- module-1 (pom.xml)
+-- module-2 (pom.xml)
With such a structure you can simple checkout the parent and get everything you need to work with. 有了这样的结构,您可以简单地检查父项并获得您需要使用的所有内容。 apart from that it will make your pom file in particular the modules part simpler which can done like this: 除此之外,它将使您的pom文件特别是模块部分更简单,可以这样做:
<modules>
<module>module-1</module>
..
<module>module-n</module>
</modules>
and your childs simply use the parent like this: 而你的孩子只需使用这样的父母:
<parent>
<groupId>..</groupId>
<artifactId>..</artifactId>
<version>...</version>
</parent>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.