##### Feature dependencies

[[feature-deps]]While references are a kind of dependencies, they require parameters in the spec of the feature declaring the reference to identify the target. Unlike references, feature dependencies do not use parameters to specify the target. Instead the dependency is declared by specifying the ID of the target feature directly.

###### Feature spec dependencies

Feature dependencies can be declared in the feature spec and/or on the feature itself. Here is an example of a dependency declaration in the feature spec:
[source,xml]
----
 <feature-spec xmlns="urn:jboss:galleon:feature-spec:1.0" name="feature1">
   <deps>
     <dep feature-id="feature2:id=123"/>
   </deps>
   <params>
     <param name="name" feature-id="true"/>
   </params>
 </feature-spec>
----

Now all the features of the spec *feature1* will depend on the feature with ID `feature2:id=123`.

###### Feature config dependencies

And here is how a feature dependency can be declared on a specific feature:
[source,xml]
----
 <feature spec="feature1">
   <deps>
     <dep feature-id="feature3:id=789"/>
   </deps>
   <param name="name" value="abc"/>
 </feature>
----

Now feature `feature1:name=abc` depends on the feature `feature2:id=123` (inherited dependency from the spec) and the feature `feature3:id=789`.

###### External feature dependencies

If the *feature3* spec was from another feature-pack than the *feature1* spec then we'd have to add the origin of the *feature3* spec to the dependency declaration. Assuming that the feature-pack the *feature1* spec belongs to declared a dependecy named *fp2* on the feature-pack the *feature3* spec belongs to, the dependency declaration will look like this:
[source,xml]
----
 <feature spec="feature1">
   <deps>
     <dep feature-id="feature3:id=789" dependency="fp2"/>
   </deps>
   <param name="name" value="abc"/>
 </feature>
----

###### Implicit inclusion of feature dependencies

Like references, dependencies also support the *include* attribute. If the dependency is declared with the *include=true*, the target of the dependency will implicitly be included into the configuration unless it is already present. Here is an example of an implicitly included feature dependency:
[source,xml]
----
 <feature spec="feature1">
   <deps>
     <dep feature-id="feature3:id=789" include="true"/>
   </deps>
   <param name="name" value="abc"/>
 </feature>
----

