Maven pull dependencies via middle pom file

自古美人都是妖i 提交于 2019-12-12 02:16:23

问题


In Maven is it possible to depend on jar1 and jar2 but establish this dependency via a middle pom file like so:

mypom.xml --> middle_pom.xml --> jar1, jar2

Can this be done in that way?

Of course the packaging for mypom.xml is whatever I want like 'war' but the packaging for middle_pom.xml would be 'pom', agree?


回答1:


As you say, make the packaging for middle_pom pom, then just add a dependency to mypom.xml like so:

<dependency>
    <groupId>com.my.group</groupId>
    <artifactId>middle_pom</artifactId>
    <version>0.1</version>
    <type>pom</type>
<dependency>

Though if you explain the reason you want to do this someone might be able to give you a more helpful suggestion.



来源:https://stackoverflow.com/questions/20677987/maven-pull-dependencies-via-middle-pom-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!