#### Named (name-only) configurations

The simplest way to provide an identity for a configuration is to give it a name. 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="config1">
    <feature spec="feature1">
      <param name="id" value="1"/>
      <param name="a" value="fp1"/>
      <param name="b" value="fp1"/>
    </feature>
    <feature spec="feature2">
      <param name="id" value="1"/>
    </feature>
  </config>
</feature-pack>
----

Now if another feature-pack provides a configuration with the same name, e.g.
[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">
  <config name="config1">
    <feature spec="feature1">
      <param name="id" value="1"/>
      <param name="b" value="fp2"/>
    </feature>
    <feature spec="feature3">
      <param name="id" value="1"/>
    </feature>
  </config>
</feature-pack>
----

And we include both of these feature packs into the same installation
[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"/>
  <feature-pack location="fp2@maven(org.jboss.universe:community-universe):1#1.0.0.Final"/>
</installation>
----

The provisioned `config1` will be the result of merging `config1` from `fp2` into `config1` from `fp1`.

IMPORTANT: Which config overwrites which (assuming they contain common parts) depends on the order in which the feature-packs are listed under `installation` element.

Here is the content of the provisioned `config1`:
[%header,options="autowidth"]
|===
|Feature spec origin |Feature spec |id |a |b
|fp1@maven(org.jboss.universe:community-universe)1#1.0.0.Final |feature1 |1 |fp1 |fp1
|===

[%header,options="autowidth"]
|===
|Feature spec origin |Feature spec |id
|fp1@maven(org.jboss.universe:community-universe)1#1.0.0.Final |feature2 |1
|===

[%header,options="autowidth"]
|===
|Feature spec origin |Feature spec |id |b
|fp2@maven(org.jboss.universe:community-universe)1#1.0.0.Final |feature1 |1 |fp2
|===

[%header,options="autowidth"]
|===
|Feature spec origin |Feature spec |id
|fp2@maven(org.jboss.universe:community-universe)1#1.0.0.Final |feature3 |1
|===

NOTE: The features of `feature1` spec are not merged although they appear to have the same ID. The reason is that `fp2` does not declare the dependency on `fp1` and its feature specs are not available in `fp2` configs. So this example assumes that both `fp1` and `fp2` include feature spec `feature1`.

Here is how `feature-pack.xml` of `fp2` had to be written so that `feature1` spec could be re-used in `fp2` config:
[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="config1">
    <feature spec="feature1">
      <param name="id" value="1"/>
      <param name="b" value="fp2"/>
    </feature>
    <feature spec="feature3">
      <param name="id" value="1"/>
    </feature>
  </config>
</feature-pack>
----

With this feature-pack configuration the resulting `config1` will include the following features:
[%header,options="autowidth"]
|===
|Feature spec origin |Feature spec |id |a |b
|fp1@maven(org.jboss.universe:community-universe)1#1.0.0.Final |feature1 |1 |fp1 |fp2
|===

[%header,options="autowidth"]
|===
|Feature spec origin |Feature spec |id
|fp1@maven(org.jboss.universe:community-universe)1#1.0.0.Final |feature2 |1
|===

[%header,options="autowidth"]
|===
|Feature spec origin |Feature spec |id
|fp2@maven(org.jboss.universe:community-universe)1#1.0.0.Final |feature3 |1
|===

