#### Named (name-only) configs

The simplest way to provide an identity for the configuration is to give it a name. E.g.

[source,xml]
----
<feature-pack xmlns="urn:jboss:galleon:feature-pack:1.0"
              groupId="org.jboss.pm.test" artifactId="fp1" version="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 config with the same name, e.g.
[source,xml]
----
<feature-pack xmlns="urn:jboss:galleon:feature-pack:1.0"
              groupId="org.jboss.pm.test" artifactId="fp2" version="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 groupId="org.jboss.pm.test" artifactId="fp1" version="1.0.0.Final"/>
  <feature-pack groupId="org.jboss.pm.test" artifactId="fp2" version="1.0.0.Final"/>
</installation>
----

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

NOTE: Which config overwrites which 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
|org.jboss.pm.test:fp1:1.0.0.Final |feature1 |1 |fp1 |fp1
|===

[%header,options="autowidth"]
|===
|Feature spec origin |Feature spec |id
|org.jboss.pm.test:fp1:1.0.0.Final |feature2 |1
|===

[%header,options="autowidth"]
|===
|Feature spec origin |Feature spec |id |b
|org.jboss.pm.test:fp2:1.0.0.Final |feature1 |1 |fp2
|===

[%header,options="autowidth"]
|===
|Feature spec origin |Feature spec |id
|org.jboss.pm.test:fp2:1.0.0.Final| feature3 |1
|===

NOTE: The features of the *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 *fp2* feature-pack.xml 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:1.0"
              groupId="org.jboss.pm.test" artifactId="fp2" version="1.0.0.Final">
  <dependencies>
    <dependency groupId="org.jboss.pm.test" artifactId="fp1" version="1.0.0.Final">
      <name>fp1-dep</name>
    </dependency>
  </dependencies>
  <config name="config1">
    <origin name="fp1-dep">
      <feature spec="feature1">
        <param name="id" value="1"/>
        <param name="b" value="fp2"/>
      </feature>
    </origin>
    <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
|org.jboss.pm.test:fp1:1.0.0.Final |feature1 |1 |fp1 |fp2
|===

[%header,options="autowidth"]
|===
|Feature spec origin |Feature spec |id
|org.jboss.pm.test:fp1:1.0.0.Final |feature2 |1
|===

[%header,options="autowidth"]
|===
|Feature spec origin |Feature spec |id
|org.jboss.pm.test:fp2:1.0.0.Final| feature3 |1
|===

