简体   繁体   English

为什么将JavaMoney依赖项打包为POM?

[英]Why the JavaMoney dependency is packages as POM?

I am not very much experienced with build systems, but this got me curious. 我对构建系统不是很有经验,但这使我感到好奇。

Most libraries use <type>jar</type> (the default) for their dependencies, but the JavaMoney library uses pom instead, what's the reason? 大多数库使用<type>jar</type> (默认)作为其依赖项,但是JavaMoney库使用pom代替,这是什么原因?

Cause JavaMoney is multi module project and root of this projects has packaging pom. 原因JavaMoney是多模块项目,该项目的根目录具有包装pom。

When you declare dependency in pom.xml it will be attached to project with their transitive dependencies. 当您在pom.xml中声明依赖项时,它将与它们的传递依赖项一起附加到项目中。 This also work for artifacts with packaging pom. 这也适用于带有包装pom的工件。 In this case transitive dependencies will be implementation of JavaMoney. 在这种情况下,传递依赖关系将是JavaMoney的实现。

mvn dependency:tree
...
[INFO] +- org.javamoney:moneta:pom:1.3:compile
[INFO] |  +- org.javamoney.moneta:moneta-core:jar:1.3:compile
[INFO] |  +- org.javamoney.moneta:moneta-convert:jar:1.3:compile
[INFO] |  +- org.javamoney.moneta:moneta-convert-imf:jar:1.3:compile
[INFO] |  +- org.javamoney.moneta:moneta-convert-ecb:jar:1.3:compile
[INFO] |  +- javax.money:money-api:jar:1.0.3:compile
[INFO] |  \- javax.annotation:javax.annotation-api:jar:1.3.2:compile

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM