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 2020/04/24 12:14:11 UTC

[sling-org-apache-sling-feature] branch master updated: SLING-9361 : Merge feature and feature.io modules

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-org-apache-sling-feature.git


The following commit(s) were added to refs/heads/master by this push:
     new 64136a2  SLING-9361 : Merge feature and feature.io modules
64136a2 is described below

commit 64136a22c0164c8b88265f8d205a81ed9b84c91d
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Apr 24 14:13:59 2020 +0200

    SLING-9361 : Merge feature and feature.io modules
---
 docs/feature-model.json | 123 ++++++++++++++++++++++++++++++++++++++++++++++++
 docs/features.md        |   6 +--
 pom.xml                 |   2 +-
 3 files changed, 127 insertions(+), 4 deletions(-)

diff --git a/docs/feature-model.json b/docs/feature-model.json
new file mode 100644
index 0000000..aff0e66
--- /dev/null
+++ b/docs/feature-model.json
@@ -0,0 +1,123 @@
+{
+    // this is a comment
+    "id": "org.apache.sling:my.app:slingosgifeature:my-classifier:1.0",
+
+    "title": "A title for the feature. (optional)",
+    "description": "A description for the feature. (optional)",
+    "vendor": "The feature vendor, for example 'Apache Software Foundation'. (optional)",
+    "license": "The license of this feature file, for example 'ASL-2'. (optional)",
+
+    // A complete feature has no external dependencies
+    "complete": true,
+
+    // A final feature cannot be used as a prototype for another feature
+    "final": false,
+
+    // variables used in configuration and framework properties are substituted at launch time.
+    "variables": {
+        "cfgvar": "somedefault",
+        "org.abc.xyz": "1.2.3",
+
+        // When converting to provisioning model, if you need a special name
+        "provisioning.model.name": ":boot"
+    },
+
+    // A prototype is another feature that is used as a prototype for this one
+    // Bundles, configurations and framework properties can be removed from the
+    //prototype. Bundles with the same artifact ID defined in the feature override
+    // bundles with this artifact ID in the Prototype
+    "prototype": 
+        {
+            "id": "org.apache.sling:some-other-feature:1.2.3",
+            "removals": {
+                "configurations": [],
+                "bundles": [],
+                "framework-properties": []
+            }
+        },
+
+    // Requirements over and above the requirements in the bundles referenced by
+    // feature.
+    "requirements": [
+        {
+            "namespace": "osgi.contract",
+            "directives": {
+                "filter": "(&(osgi.contract=JavaServlet)(version=3.1))"
+            }
+        }
+    ],
+
+    // Capabilities over and above the capabilities provided by the bundles referenced
+    // by the feature.
+    "capabilities": [
+        {
+            "namespace": "osgi.implementation",
+            "attributes": {
+                "osgi.implementation": "osgi.http",
+                "version:Version": "1.1"
+            },
+            "directives": {
+                "uses": "javax.servlet,javax.servlet.http,org.osgi.service.http.context,org.osgi.service.http.whiteboard"
+            }
+        },
+        {
+            "namespace": "osgi.service",
+            "attributes": {
+                "objectClass:List<String>": "org.osgi.service.http.runtime.HttpServiceRuntime"
+            },
+            "directives": {
+                "uses": "org.osgi.service.http.runtime,org.osgi.service.http.runtime.dto"
+            }
+        }
+    ],
+
+    // Framework properties to be provided to the running OSGi Framework
+    "framework-properties": {
+        "foo": 1,
+        "org.osgi.framework.storage": "${tempdir}",
+        "org.apache.felix.scr.directory": "launchpad/scr"
+    },
+
+    // The bundles that are part of the feature. Bundles are referenced using Maven
+    // coordinates and can have additional metadata associated with them. Bundles can
+    // specified as either a simple string (the Maven coordinates of the bundle) or
+    // as an object with 'id' and additional metadata.
+    "bundles": [
+        {
+            "id": "org.apache.sling:security-server:2.2.0",
+            "hash": "4632463464363646436",
+
+            // This is the relative start order inside the feature
+            "start-order": 5
+        },
+        {
+            "id": "org.apache.sling:application-bundle:2.0.0",
+            "start-order": 10
+        },
+        "org.apache.sling:foo-xyz:1.2.3"
+    ],
+
+    // The configurations are specified following the format defined by the OSGi Configurator
+    // specification: https://osgi.org/specification/osgi.cmpn/7.0.0/service.configurator.html
+    // Variables declared in the variables section can be used for late binding of variables
+    // they can be specified with the Launcher, or the default from the variables section is used.
+    // Factory configurations can be specified using the named factory syntax, which separates
+    // The factory PID and the name with a tilde '~'
+    "configurations": {
+        "my.pid": {
+            "foo": 5,
+            "something-enabled": false,
+            "bar": "${cfgvar}",
+
+            // The tempdir variable is not specified at the variables section.
+            // It needs to be provided at launch, otherwise the launch will stop.
+            "tempdir": "${tempdir}",
+
+
+            "number:Integer": 7
+        },
+        "my.factory.pid~name": {
+           "a.value":"yeah"
+        }
+    }
+}
diff --git a/docs/features.md b/docs/features.md
index 45b8ab5..835cbf6 100644
--- a/docs/features.md
+++ b/docs/features.md
@@ -41,12 +41,12 @@ Same id specified as a Maven url:
 
 ## Feature File Format
 
-Features are defined as a JSON object. An example feature file can be found here: https://github.com/apache/sling-org-apache-sling-feature-io/blob/master/design/feature-model.json
-and the JSON Schema for feature files is available from here: https://github.com/apache/sling-org-apache-sling-feature-io/blob/master/src/main/resources/META-INF/feature/Feature-1.0.0.schema.json.
+Features are defined as a JSON object. An example feature file can be found here: [feature-model.json](feature-model.json)
+and the JSON Schema for feature files is available from here: [Feature-1.0.0.schema.json](../src/main/resources/META-INF/feature/Feature-1.0.0.schema.json).
 
 Comments in the form of [JSMin (The JavaScript Minifier)](https://www.crockford.com/javascript/jsmin.html) comments are supported, that is, any text on the same line after // is ignored and any text between /* */ is ignored.
 
-Java API for Serialization/Deserialization into/from this format is available from https://github.com/apache/sling-org-apache-sling-feature-io.
+Java API for Serialization/Deserialization into/from this format is part of this module.
 
 ## OSGi Bundles
 
diff --git a/pom.xml b/pom.xml
index a54b03b..9898ca8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     </parent>
 
     <artifactId>org.apache.sling.feature</artifactId>
-    <version>1.1.9-SNAPSHOT</version>
+    <version>1.2.0-SNAPSHOT</version>
 
     <name>Apache Sling Feature</name>
     <description>