### Disabling package inheritance from a dependency

The effective package set of a dependency is inherited by the feature-pack declaring the dependency. However, it is possible to declare the dependency without inheriting its default effective package set and simply pick the desired packages explicitly under `dependency` element (in other words, explicitly define the desired effective package set of the dependency).

Optional boolean attribute `inherit` of element `packages` controls whether package inheritance is enabled or disabled. In case the attribute is not explicitly specified, its value is assumed to be true. Here is an example of a dependency with disabled package inheritance:

[source,xml]
----
 <feature-pack xmlns="urn:jboss:galleon:feature-pack:2.0"
                location="fp1@maven(org.jboss.universe:community-universe):1#1.0.0" >
    <dependencies>
        <dependency location="fp2@maven(org.jboss.universe:community-universe):2#2.0.0">
            <packages inherit=”false”>
                <exclude name="p1"/>
                <exclude name="p2"/>
                <include name="p3"/>
                <include name="p4"/>
            </packages>
        </dependency>
    </dependencies>
    <default-packages>
        <package name="p1"/>
        <package name="p2"/>
    </default-packages>
 </feature-pack>
----

NOTE: The `exclude` elements may at first look redundant, given that package inheritance was disabled in the first place. However, it's important to keep in mind that when a package is included, by default, all its dependencies are also included. `exclude` elements can be used to exclude certain transitive dependencies of the included dependencies.

Now the effective package set of the distribution provisioned from `fp1` becomes:

* `fp1` packages `p1` and `p2`;

** plus their dependencies on non-default packages (if any);

* `fp2` packages `p3` and `p4`;

** plus their dependencies on non-default packages minus packages `p1` and `p2` from `fp2` and their dependencies on other packages.
