Author: kwin
Date: Fri Dec 9 08:34:52 2016
New Revision: 1773335
URL: http://svn.apache.org/viewvc?rev=1773335&view=rev
Log:
SLING-6084 provide example configuration for generating `Sling-Model-Packages`
header through the bnd plugin
Modified:
sling/site/trunk/content/documentation/bundles/models.mdtext
Modified: sling/site/trunk/content/documentation/bundles/models.mdtext
URL:
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/models.mdtext?rev=1773335&r1=1773334&r2=1773335&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/bundles/models.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/models.mdtext Fri Dec 9
08:34:52 2016
@@ -479,9 +479,9 @@ through the `@Exporter` annotation's `se
model, exported as a `java.lang.String` (via the named Exporter) and then
returned to the client.
-# Registration of Sling Models classes via bnd plugin (since 1.3.4)
+# Registration of Sling Models classes via bnd plugin
-Since Sling Models Implementation 1.3.4 it is possible to automatically
generated the necessary bundle header to register the Sling Models classes
contained in the Maven bundle project by using the Sling Models bnd plugin -
either with maven-bundle-plugin or with bnd-maven-plugin. By default the plugin
generates a `Sling-Model-Classes` header.
+With the Sling Models bnd plugin it is possible to automatically generated the
necessary bundle header to register the Sling Models classes contained in the
Maven bundle project - either with maven-bundle-plugin or with
bnd-maven-plugin. By default the plugin generates a `Sling-Model-Classes`
header (only compatible with Sling Models Impl since version 1.3.4, see
[SLING-6308](https://issues.apache.org/jira/browse/SLING-6308)).
Example configuration:
@@ -505,3 +505,12 @@ Example configuration:
</plugin>
If a `Sling-Model-Packages` or `Sling-Model-Classes` was already manually
defined for the bundle the bnd plugin does nothing. So if you want to migrate
an existing project to use this plugin remove the existing header definitions.
+
+If you want to generate a bundle header compliant with Sling Models < 1.3.4
(i.e. `Sling-Model-Packages`) you need to specify the attribute
`generatePackagesHeader=true`. An example configuration looks like this
+
+ #!xml
+ <configuration>
+ <instructions>
+
<_plugin>org.apache.sling.bnd.models.ModelsScannerPlugin;generatePackagesHeader=true</_plugin>
+ </instructions>
+ </configuration>
\ No newline at end of file