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 2015/04/30 16:06:52 UTC

svn commit: r1676994 - /sling/site/trunk/content/documentation/development/slingstart.mdtext

Author: cziegeler
Date: Thu Apr 30 14:06:52 2015
New Revision: 1676994

URL: http://svn.apache.org/r1676994
Log:
Add section about maven plugin and :remove feature

Modified:
    sling/site/trunk/content/documentation/development/slingstart.mdtext

Modified: sling/site/trunk/content/documentation/development/slingstart.mdtext
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development/slingstart.mdtext?rev=1676994&r1=1676993&r2=1676994&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/development/slingstart.mdtext (original)
+++ sling/site/trunk/content/documentation/development/slingstart.mdtext Thu Apr 30 14:06:52 2015
@@ -159,5 +159,51 @@ While the default configuration form is
     com.acme.xyz [format=properties] 	 
         ftp.port = 21
         
-Notice that this model only supports string properties. Therefore the service consuming the configuration needs to be able to adapt a string value to the correct type.
+Notice that this definition only supports string properties. Therefore the service consuming the configuration needs to be able to adapt a string value to the correct type.
 
+## Slingstart and Slingfeature projects
+
+The slingstart Maven plugin introduces two new packaging types:
+
+* slingstart : This type requires a model at src/main/provisioning. It reads all text files in that directory and merges them in alphabetical order. The resulting artifact is a runnable jar. The assembled model is also attached to the project artifacts.
+* slingfeature : This type requires a model at src/main/provisioning. It reads all text files in that directory and merges them in alphabetical order and creates a merged model which is the final artifact of this project.
+
+A model can reference other slingstart or slingfeature artifacts. When such an artifact is reference, the type needs to be specified, for example:
+
+   [artifacts]
+       org.apache.sling/org.apache.sling.launchpad/8-SNAPSHOT/slingstart
+       org.apache.sling/org.apache.sling.launchpad.test-bundles/0.0.1-SNAPSHOT/slingfeature
+
+The resulting model is a merged model, starting with the dependencies and then merging in the current model.
+
+### Model Merging
+
+Two models are merged feature by feature - each feature is treated as a separate unit. Within a feature each run mode is treated separately as well. Within a run mode a model can overwrite definitions from the base model. For example, it can define a different configuration or a different version and/or start level for an artifact.
+In addition, it can also remove artifacts and configurations. For this the special runmode :remove needs to be used together with all run modes the artifact or configuration is currently in.
+
+Let's look at an example base model
+
+   [artifacts]
+       my/special/artifact/1.0.0
+       commons/library/1.0.0
+       
+   [artifacts runModes=test]
+       another/one/2.1.0
+
+Now, another model wants to use the above model as it's base but:
+
+* Change the version of the commons library to 1.1.0 and move it to a different start level.
+* Remove the "special artifact"
+* Remove the "another one"
+
+The changing model would mention the above as one artifact and in addition have:
+    [artifacts startLevel=5]
+        commons/library/1.1.0
+    
+    [artifacts runModes=:remove]
+        my/special/artifact/0.0.0
+    
+    [artifacts runModes=:remove,test]
+        another/one/0.0.0
+
+Note that the version for removal does not play a role, it's not compared for an exact match. Configurations can be removed in the same way by just specifying their PID in the :remove run mode.