POM_ADD_DEP(7)

πŸ’– POM_ADD_DEP(7) πŸ’–

okay bestie, gather round, because we're talking about pom_add_dep β€” the Java Packages Tools girlie whose whole job is adding a dependency to a Maven POM file or an Ivy module. yes she's that macro. the manual name is POM_ADD_DEP(7) btw, iykyk πŸŽ€


✨ NAME ✨

pom_add_dep β€” add dependency to Maven POM file or Ivy module πŸ¦‹


🌸 SYNOPSIS 🌸

%pom_add_dep groupId:artifactId[:version[:scope]] [POM-location]...
[extra-XML]

%pom_add_dep org:name[:rev[:conf[:transitive]]] [Ivy-module-location]...
[extra-XML]

%pom_add_dep_mgmt groupId:articId[:version[:scope]] [POM-location]...
[extra-XML]

(and yes, <hotpink>that middle one is the Ivy flavor</hotpink>, and the last one is her sister macro pom_add_dep_mgmt β€” we'll get to her πŸ’…)


πŸ’… DESCRIPTION πŸ’…

so basically these macros go in and patch a POM file or an Ivy file you point them at, and they add a dependency on the Maven artifact you describe with artifact coordinates. simple as that, no cap.

  • pom_add_dep drops that dependency into the <dependencies> XML node.
  • pom_add_dep_mgmt drops it into <dependencyManagement> instead. different node, different vibe, same energy ✨

🧚 the Maven coordinates (groupId / artifactId / version / scope)

groupId and artifactId are the identifiers of the Maven artifact you're adding a dependency on. they MUST be specified. non-negotiable, bestie, they're the whole point.

  • if version isn't specified, the default value is "any".
  • if scope isn't specified, then no scope is defined at all β€” and heads up, Maven itself defaults to "compile" in that case. (so like, the macro leaves it blank, Maven fills in the blanks, teamwork 🫢)

🌈 Ivy modules specifically

when you're modifying Ivy modules, the mapping is:

  • org ↔ Maven's groupId
  • name ↔ Maven's artifactId
  • rev ↔ Maven's version

Org and name must be specified, and the other attributes just use their defaults. the rest:

  • conf β€” specifies the configuration in which the dependency should apply.
  • transitive β€” specifies whether the dependency should also pull in its dependencies. it accepts boolean values: true or false. when unspecified, Ivy defaults to true.

πŸ“ where do the files even live (POM location)

POM location can be one of two things:

  1. a full path to the POM or Ivy file itself, or
  2. a path to the directory that contains pom.xml or ivy.xml.

if you don't give a POM location at all, then pom.xml or ivy.xml from the current working directory gets used. and here's the thing β€” when both pom.xml and ivy.xml are present, pom.xml is the one that gets processed. main character energy, honestly.

you can specify more than one file location and every single one of them will be processed. go off πŸ‘‘

πŸŽ€ extra XML

Extra XML is additional XML code that gets added into the <dependency> node. this parameter can be omitted, and if you do omit it, then no extra XML is appended. that's it, that's the whole bit.


πŸ”₯ EXAMPLES πŸ”₯

%pom_add_dep foo:bar baz

this call adds a dependency on artifact foo:bar to the baz/pom.xml file. iconic, no notes πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

Written by Mikolaj Izdebski.


😭 REPORTING BUGS 😭

Bugs should be reported through the Java Packages Tools issue tracker at Github: https://github.com/fedora-java/javapackages/issues

(please actually report them, the maintainers wanna know, don't just suffer in silence bestie πŸ™ˆ)


🌟 SEE ALSO 🌟


and that's the whole page, bestie!! this one's from JAVAPACKAGES, dated 2025-09-19, and it lives at POM_ADD_DEP(7) πŸ¦‹ go forth and add your deps, you absolute legend πŸ’œβœ¨πŸŽ€
πŸ“¦ where this page comes from