如何为级联/传递依赖项配置Maven POM.XML文件

时间:2016-11-17 09:39:49

标签: java maven netbeans pom.xml

组件安排:

Component_A - 第三方库/ API(一组罐子) - Maven源

Component_B1 - 我自己创建的API - 1 - 取决于Component_A
Component_B2 - 我自己创建的API - 2 - 取决于Component_A

App_C1 - app - 可执行jar - 取决于Component_B1 App_C2 - app - 可执行jar - 取决于Component_B2

部署安排要求(为简化起见,简化路径):

Component_A  - deploy to:                                             ...\java\.m2\repository\lib\Component_A\*
Component_B1 - make jar with dependency on Component_A and deploy to: ...\java\.m2\repository\lib\Component_B1\*
Component_B2 - make jar with dependency on Component_A and deploy to: ...\java\.m2\repository\lib\Component_B2\*
App_C1 - make executable jar with dependency on Component_B1 and deploy to: ...\java\apps\Component_C1\*
App_C2 - make executable jar with dependency on Component_B2 and deploy to: ...\java\apps\Component_C1\*

对于每个组件,POM.XML文件的外观如何,以便我们最终可以在命令行上执行:

java -jar App_C1.jar

java -jar App_C2.jar

0 个答案:

没有答案