0

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?

Jacob G.
  • 28,856
  • 5
  • 62
  • 116
Michel Feinstein
  • 13,416
  • 16
  • 91
  • 173
  • Possible duplicate of [What is "pom" packaging in maven?](https://stackoverflow.com/questions/7692161/what-is-pom-packaging-in-maven) – SiKing Dec 19 '18 at 00:27
  • I don't think it's a duplicate because I want to understand why this decision was made. The link explains that there are Submodules in Maven and that's why it packages as POM.... But I have seen many projects with Submodules that output jars – Michel Feinstein Dec 19 '18 at 00:33
  • 1
    Presumably, they decided that they didn't want the library to be packaged as a single JAR file. Why? Ask them! (You have not given us a link to the POM file to look at **in context** ... so we don't actually know which of the many POMs you might be talking about.) – Stephen C Dec 19 '18 at 00:43
  • That's why I posted here, so they can answer, since they monitor the tags I included and this is the place for answering questions... I won't open an issue at their github repo since this isn't an issue... And a question in gitter gets lost – Michel Feinstein Dec 19 '18 at 00:45
  • 1
    Well [good luck with that](https://stackoverflow.com/tags/java-money/topusers) :-) Many developers have neither the time or the inclination to answer "why did you make that design decision" questions like this. – Stephen C Dec 19 '18 at 00:54
  • :/ I guess I am too spoiled by the Flutter team – Michel Feinstein Dec 19 '18 at 20:14

1 Answers1

1

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
aggredi
  • 406
  • 3
  • 11