Apache Sling Feature Model - API Regions Extension

Clone this repo:
  1. 591a333 [maven-release-plugin] prepare for next development iteration by Carsten Ziegeler · 5 weeks ago master
  2. 9683e2b [maven-release-plugin] prepare release org.apache.sling.feature.extension.apiregions-1.1.0 by Carsten Ziegeler · 5 weeks ago org.apache.sling.feature.extension.apiregions-1.1.0
  3. 0b10329 SLING-8783 : Create API for api regions by Carsten Ziegeler · 5 weeks ago
  4. 63a18d5 Ignore org.xml. packages as well by Carsten Ziegeler · 5 weeks ago
  5. d8f2b64 SLING-8783 : Create API for api regions by Carsten Ziegeler · 6 weeks ago

Build Status Test Status License feature

Apache Sling API Regions extension

This component contains extensions relating to the API Regions component. For more information about API Regions see https://github.com/apache/sling-org-apache-sling-feature/blob/master/apicontroller.md

The following extensions are registered via the ServiceLoader mechanism:


Merge handlers are called when features are merged during the aggregation process.

APIRegionMergeHandler - This handler knows how to merge API Regions extensions and adds the org-feature key to the api-regions sections to record what feature this section originally belonged.


PostProcessHandlers are called when a feature contains an api-regions section.

BundleMappingHandler - This handler creates a mapping file idbsnver.properties that maps the Artifact ID to a bundle symbolic name and version. A tilde ~ is used in the value of the map to separate BSN and version.

BundleArtifactFeatureHandler - This handler creates 3 mapping files:

  • bundles.properties: maps bundles to the original feature they were in. A bundle could be from more then one feature.
  • features.properties: maps features to regions. A feature can be in more than one region.
  • regions.properties: maps regions to packages. A region can expose more than one package.

The location of the files created by the BundleArtifactFeatureHandler handler is stored in a system property with name sling.feature.apiregions.resource. + filename. So to obtain the file name of the bundles.properties file, make the following call:


These properties are read by the https://github.com/apache/sling-org-apache-sling-feature-apiregions component for runtime enforcement of the API Regions.