POM_ADD_DEP

Section: Java Packages Tools (7)
Updated: 02/01/2019
Page Index
 

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]  

DESCRIPTION

These macros patch specified POM or Ivy file adding a dependency on given Maven artifact specified by artifact coordinates. pom_add_dep adds the dependency to <dependencies> XML node, while pom_add_dep_mgmt adds it to <dependencyManagement>.

groupId and artifactId are identifiers of Maven artifact on which dependency is to be added. They must be specified. If version is not specified then default value of "any" is used. If scope is not specified then no scope is defined (Maven defaults to "compile" in this case).

When modifying Ivy modules, the org, name and rev correspond to the Maven groupId and artifactId and version. Org and name must be specified, other attributes use defaults. The conf attribute specifies the configuration in which the dependency should apply. The transitive attribute specifies whether the dependency should also pull in it's dependencies. It accepts boolean values - true or false. When unspecified Ivy defaults to true.

POM location can be either a full path to the POM or Ivy file, or a path to the directory containing pom.xml or ivy.xml. If POM location is not given then pom.xml or ivy.xml from current working directory is used. When both pom.xml and ivy.xml are present, pom.xml is processed. You can specify more file locations which will be processed.

Extra XML is additional XML code to be added into the <dependency> node. This parameter can be ommited, in which case no extra XML is appended.  

EXAMPLES

%pom_add_dep foo:bar baz - this call adds dependency on artifact foo:bar to baz/pom.xml file.  

AUTHOR

Written by Mikolaj Izdebski.  

REPORTING BUGS

Bugs should be reported through Java Packages Tools issue tracker at Github: m[blue]https://github.com/fedora-java/javapackages/issuesm[].  

SEE ALSO

pom_add_parent(7), pom_add_plugin(7), pom_disable_module(7), pom_remove_dep(7), pom_remove_parent(7), pom_remove_plugin(7), pom_change_dep(7), pom_set_parent(7), pom_xpath_inject(7), pom_xpath_remove(7), pom_xpath_replace(7), pom_xpath_set(7).


 

Index

NAME
SYNOPSIS
DESCRIPTION
EXAMPLES
AUTHOR
REPORTING BUGS
SEE ALSO