# configurations

Tag: configurations Parent: ivy-module
A container for configuration elements. If this container is not present, it is assumed that the module has one public configuration called 'default'.
since 2.2 You can define the default conf on this container by specifying the defaultconf attribute. This attribute defines the conf mapping to use when no conf mapping is specified for a dependency in this ivy file.
since 1.3 You can define a default conf mapping on this container by specifying the defaultconfmapping attribute.
This attribute modifies the way ivy interprets conf mapping with no mapped conf. In this case, Ivy will look in the default conf mapping and use the conf mapping defined in the default conf mapping for the conf for which there is no mapped conf.
In order to maintain backwards compatibility with Ivy 2.1.0 and earlier, the defaultconfmapping also provides one additional function. If no defaultconf is specified (on either the configurations tag or the dependencies tag), the defaultconfmapping becomes the default configuration for dependencies in this ivy file when no configuration is specified. In other words, in addition to altering the interpretation of individual configurations with no mapping, defaultconfmapping also performs exactly like defaultconf in the absence of a definition for defaultconf.
If several defaultconfmapping or defaultconf attributes are defined (in the configurations tag, one or several in an included configurations file, and/or in the dependency tag, then it's only the last definition of each property which is taken into account. The others will have no effect at all.
See examples below to clarify the behavior of these two attributes together.
since 1.4 You can activate a confmappingoverride mode for all configurations, in which case the extending configurations will override the mappings of the configurations they extend from.

# Attributes

Attribute | Description | Required
--- | --- | ---
defaultconf | the default conf to use in this ivy file since 2.2 | No, defaults to no default conf
defaultconfmapping | the default conf mapping to use in this ivy file since 1.3 | No, defaults to no default conf mapping
confmappingoverride | true to activate configuration mapping override, false otherwise since 1.4 | No, defaults to false

# Child elements

Element | Description | Cardinality
--- | --- | ---
conf | declares a configuration of this module | 0..n
include | include configurations from another file | 0..n

# Configuration mappings details

When Ivy parses your Ivy file, it will create (internally) modify the configuration mapping of your dependencies.
For instance, say you have:

    <configurations defaultconfmapping="conf1->other1;conf2->other2">
       <conf name="conf1" />
       <conf name="conf2" extends="conf1" />
    </configurations>
    <dependencies>
       <dependency name="other-module" conf="conf1" />
    </dependencies>

When Ivy parses this file, it will construct the following dependency (in-memory only):

    <dependency name="other-module" conf="conf1->other1" />

So, if you now resolve the conf2 configuration, you will only get the other1 dependencies of your other-module.
But when you set confmappingoverride to true, Ivy will construct the following dependency in memory:

    <dependency name="other-module" conf="conf1->other1;conf2->other2" />

As you can see, the defaultmappings of the extending configurations are also added (although you didn't explicitly defined them)
When you now resolve the conf2 configuration, you'll get the other2 dependencies of your other-module.

# Examples involving defaultconf and defaultconfmapping

The table below indicates how Ivy interprets the conf attribute according to how defaultconfmapping and defaultconf are set:

defaultconf | defaultconfmapping | conf | ivy interpretation
--- | --- | --- | ---

    *->*

runtime

    runtime->runtime

test

    test->test

    runtime

    runtime->runtime

    runtime

    runtime->*;test->default

runtime->*

    runtime

    runtime->*;test->default

test

test->default

    runtime->*;test->default

    runtime->*;test->default

    runtime->*;test->default

runtime

    runtime->*

    runtime->*;test->default

test

    test->default