Why the JavaMoney dependency is packages as POM?

372 Views Asked by At

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?

1

There are 1 best solutions below

0
On BEST ANSWER

Cause JavaMoney is multi module project and root of this projects has packaging pom.

When you declare dependency in pom.xml it will be attached to project with their transitive dependencies. This also work for artifacts with packaging pom. In this case transitive dependencies will be implementation of 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