You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2019/11/04 09:12:50 UTC

[sling-slingfeature-maven-plugin] branch master updated: Add docs about the feature ID

This is an automated email from the ASF dual-hosted git repository.

cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-slingfeature-maven-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new fc85647  Add docs about the feature ID
fc85647 is described below

commit fc85647f755ccb8a82b8f1529283bb6b388c9205
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Nov 4 10:12:37 2019 +0100

    Add docs about the feature ID
---
 README.md | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/README.md b/README.md
index 4a08406..b375bbe 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,34 @@ This module is part of the [Apache Sling](https://sling.apache.org) project.
 
 Maven Plugin for OSGi Applications
 
+# Authoring Feature Files
+
+The format of a feature file is described in the [Apache Sling Feature Model](https://github.com/apache/sling-org-apache-sling-feature/blob/master/readme.md).
+As described there, a feature file must have an ID. If you use this Maven Plugin you have two options:
+
+* Including the full ID in the source of your feature file
+* Let the plugin generate the ID for you
+
+## Including the ID in the feature file
+
+If you want to have full control over the ID, you can encode it directly in the feature file. However, it is advised to use placeholders for the group id, artifact id
+and version and let the maven plugin insert them for you.
+
+In the following example the qualifier `base` is specified for the feature file:
+
+```
+   {
+      "id":"${project.groupId}:${project.artifactId}:slingosgifeature:base:${project.version}",
+      ...
+   }
+```
+
+## Auto generated ID
+
+If you omit the ID in your feature file, the maven plugin will generate an ID for you based on the file name of the feature file. The file name becomes the qualifier of the ID.
+If your feature is named `feature.json` then this becomes the main artifact of the project without a qualifier.
+
+
 # Global Configuration
 
 * features : The directory containing the feature files. The default is `src/main/features`.