### Content of `config` element

NOTE: Although this chapter is describing `config` element as a child of `feature-pack` element, the same applies to the root `config` element from `config.xml` and `model.xml` files.

`config` element is basically an extended version of <<_feature_groups,`feature-group` element>>. Meaning that everything that is allowed in the body of `feature-group` (which is `feature`, `feature-group` and `origin` elements for explicit dependency origins) is allowed in `config` element.

Besides that `config` element supports already mentioned in an earlier chapter the <<_configuration_model_attributes, config attributes>> and `props` element.

IMPORTANT: When a `config` element appears in a `feature-pack.xml` file or as a child of `installation` element in the provisioning configuration of the installation, it represents all the configurations with the matching identity from all the feature-packs dependency hierarchy up to the current point merged into one configuration model.

E.g. if feature-pack `fp1` depends on feature-pack `fp2` which includes configuration model `m1` named `n1`. Element `config` with attributes `model="m1" name="n1"` added to `fp1` will represent the corresponding configuration from `fp2` (unless the configuration inheritance was explicitly disabled in `fp1`), i.e. the content of configuration *m1:n1* from `fp2` may be manipulated in `config` element in `fp1` by excluding certain features or overwriting their parameters.

The same applies to `config` elements under `installation` element. If `installation` includes feature-packs `fp3` and `fp4`, both of which include configs `m1:n1`, `config` element with attributes `model="m1" name="n1"` added under the `installation` element will represent the result of merging configs `m1:n1` from feature-packs `fp3` and `fp4`.

#### Configuration properties

`props` element allows to attach various properties to the configuration that can be meaningful to the provisioning plugins processing the configuration. E.g.
[source,xml]
----
<feature-pack xmlns="urn:jboss:galleon:feature-pack:2.0"
              location="fp1@maven(org.jboss.universe:community-universe):1#1.0.0.Final">
  <config name="main" model="modelA">
    <props>
      <prop name="save-to-file" value="model-a.xml"/>
      <prop name="other" value="thing"/>
    </props>
    <feature spec="feature1">
      <param name="id" value="1"/>
      <param name="a" value="fp1-modelA"/>
    </feature>
  </config>
</feature-pack>
----

#### Overwriting configuration properties during inclusion

When a default configuration is included, its properties can be overwritten, e.g.
[source,xml]
----
<installation xmlns="urn:jboss:galleon:provisioning:1.0">
    <feature-pack location="fp1@maven(org.jboss.universe:community-universe):1#1.0.0.Final">
        <default-configs>
            <include name="main" model="modelA">
              <props>
                <prop name="save-to-file" value="main-model-a.xml"/>
              </props>
            </include>
        </default-configs>
    </feature-pack>
</installation>
----

The resolved configuration will include the following properties:

* save-to-file=main-model-a.xml;

* other=thing.

#### Overwriting configuration properties during merging

When the <<_configuration_model_merges,configurations are merged>>, their properties are also merged. The configuration that is included later into the installation overwrites the properties of the configuration which was added earlier. E.g.
[source,xml]
----
<feature-pack xmlns="urn:jboss:galleon:feature-pack:2.0"
              location="fp1@maven(org.jboss.universe:community-universe):1#1.0.0.Final">
  <config model="modelA">
    <props>
      <prop name="save-to-file" value="model-a.xml"/>
      <prop name="other" value="thing"/>
    </props>
    <feature spec="feature1">
      <param name="id" value="1"/>
      <param name="a" value="fp1-modelA"/>
    </feature>
  </config>
</feature-pack>
----

[source,xml]
----
<feature-pack xmlns="urn:jboss:galleon:feature-pack:2.0"
              location="fp2@maven(org.jboss.universe:community-universe):1#1.0.0.Final">
  <dependencies>
    <dependency location="fp1@maven(org.jboss.universe:community-universe):1#1.0.0.Final"/>
  </dependencies>
  <config name="main" model="modelA">
    <props>
      <prop name="save-to-file" value="main-model-a.xml"/>
    </props>
    <feature spec="feature1">
      <param name="id" value="1"/>
      <param name="a" value="fp2-modelA"/>
    </feature>
  </config>
</feature-pack>
----

The resolved configuration `modelA:main` will contain the following properties:

* save-to-file=main-model-a.xml;

* other=thing.

