Tag: include

[since 1.3]

Includes another Ivy settings file as if it were part of this one.

The included Ivy settings file has to be a complete well formed Ivy settings file, i.e. it does have to include the <ivysettings> tag.


Attribute Description Required


a URL to the Ivy settings file to include

Yes, unless file is specified


a path to the Ivy settings file to include

Yes, unless url is specified


indicates whether Ivy should throw an error if the specified file doesn’t exist (since 2.4).

No, default to false


  <property name="myrepository" value="path/to/my/real/rep"/>
  <settings defaultResolver="default"/>
  <include file="path/to/ivysettings-default.xml"/>

with ivysettings-default.xml:

  <property name="myrepository" value="path/to/rep" overwrite="false"/>
    <ivyrep name="default" ivyroot="${myrepository}"/>

The included Ivy settings defines a resolver named default, which is an ivyrep resolver, with its root configured as being the value of myrepository variable. This variable is given the value path/to/rep in the included file, but because the attribute overwrite is set to false, it will not override the value given in the main Ivy settings including this one, so the value used for myrepository will be path/to/my/real/rep.

  <include file="ivysettings-macro.xml"/>
    <mymacro name="includeworks" mymainrep="included/myrep" mysecondrep="included/secondrep"/>

with ivysettings-macro.xml being the Ivy settings example given on the macrodef documentation page. This lets us easily reuse the custom macro resolver.