Apache Sling Feature Model Analyser

Clone this repo:
  1. 09dbab6 [maven-release-plugin] prepare for next development iteration by David Bosschaert · 5 days ago master
  2. a6ddfad [maven-release-plugin] prepare release org.apache.sling.feature.analyser-1.3.18 by David Bosschaert · 5 days ago org.apache.sling.feature.analyser-1.3.18
  3. 13e9bde Mention the repoinit analyser in the README by Robert Munteanu · 5 days ago
  4. 364ffbf SLING-10055: add simple caching for FeatureProvider lookups. (#29) by Karl Pauls · 5 days ago
  5. a72c7bc [maven-release-plugin] prepare for next development iteration by David Bosschaert · 4 weeks ago

Apache Sling

Build Status Test Status Coverage Sonarcloud Status JavaDoc Maven Central feature License

Feature Model Analyser

The Analyser can analyse features for completeness and correctness. The analyser is pluggable and can also perform other checks.

The analyser can be run from the commandline by running the following main class:

java org.apache.sling.feature.analyser.main.Main

Feature Model Analyser as a Maven Plugin

The Analyser can also be run as part of a maven build via the slingfeature-maven-plugin: https://github.com/apache/sling-slingfeature-maven-plugin

The following analysers are defined:

  • bundle-packages: Checks bundle import/export package statements for consistency and completeness. Does not take API Regions into account. An expanded variant of this analyser is available in org-apache-sling-feature-extension-apiregions under the name api-regions-exportsimports.

  • bundle-content: Gives a warning if a bundle container initial content specified with Sling-Initial-Content.

  • bundle-resources: Gives a warning if a bundle contains resources specified with Sling-Bundle-Resources.

  • compare-features: Compares the artifacts in the bundles sections or in an extension between two feature models. For more information see below.

  • requirements-capabilities: Checks bundle requirements/capabilities for consistency and completeness.

  • apis-jar: Validates that the entries related to Apis Jar are valid.

  • repoinit: Checks the syntax of all repoinit sections.

Additional analysers in relation to Feature Model API Regions can be found here: https://github.com/apache/sling-org-apache-sling-feature-extension-apiregions

For further documentation see: https://github.com/apache/sling-org-apache-sling-feature/blob/master/readme.md


This analyser compares certain sections of two feature models.

This analyser requires additional configuration:

Configuration keyAllowed valuesDescription
compare-typeARTIFACTSThe types of entities being compared. Currently only artifacts can be compared.
compare-withMaven ID, e.g. mygroup:myart:1.2.3The golden feature to compare the features selected for the analyser with.
compare-extensionextension nameIf this configuration is absent, the feature's bundles are compared. Otherwise the extensions with the specified name are compared. These extensions must be of type ARTIFACTS.
compare-modeSAME or DIFFERENTWhether the sections must be the same or must be different. Defaults to SAME.
compare-metadatatrue or falseWhether to include the artifact metadata in the comparison. Defaults to false.