|
Page Edited :
SLINGxSITE :
Sling
Sling has been edited by Felix Meschberger (May 19, 2008). Change summary: Add description of refreshPackages setting for install-file Maven Sling PluginThe Maven Sling Plugin provides a number of goals which may be of help while developping bundles for Sling:
The install goalThe install goal uploads a bundle to a running sling instance, which may be located on a remote system. The plugin places an HTTP POST request to the sling instance sending the bundle file together with flags indicating whether to start the bundle and what start level to assign the bundle. UseTo use the install goal of the Maven Sling Plugin define the following elements in the <plugins> section of the POM: <?xml version="1.0" encoding="ISO-8859-1"?> <project> .... <build> .... <plugins> .... <plugin> <groupId>org.apache.sling</groupId> <artifactId>maven-sling-plugin</artifactId> <executions> <execution> <id>install-bundle</id> <goals> <goal>install</goal> </goals> </execution> </executions> </plugin> .... <plugins> .... <build> .... <project>
The install-file goalThe install-file goal is equivalent to the install goal except, that the install-file does not require a project descriptor file while the install goal does. In other words the install-file goal may used to upload any bundle file available to a running Sling instance. UseThe install-file goal may only be used from the command line by explicitly calling it as in: $ mvn org.apache.sling:maven-sling-plugin:install-file -Dsling.file=<file> Specifying the bundle file to upload with the sling.file property is required. ConfigurationThe install-file supports the same configuration parameters as the install goal with the exception of the skip parameter which makes no sense. In addition, all parameters must be specified on the command line by setting system properties. The bundleFileName parameter specified as the sling.file system property is required by the install-file goal. For a description of the parameters see the configuration section of the install goal above. Example: To upload the bundle file someBundle.jar you might use the goal as follows: $ mvn org.apache.sling:maven-sling-plugin:install-file -Dsling.file=someBundle.jar The deploy goalThe deploy goal uploads a bundle to a Sling OSGi Bundle Repository server implemenred by the sling-obr bundle, which may be located on a remote system. The plugin places an HTTP POST request to the server sending the bundle file. UseTo use the deploy goal of the Maven Sling Plugin define the following elements in the <plugins> section of the POM: <?xml version="1.0" encoding="ISO-8859-1"?> <project> .... <build> .... <plugins> .... <plugin> <groupId>org.apache.sling</groupId> <artifactId>maven-sling-plugin</artifactId> <executions> <execution> <id>deploy-bundle</id> <goals> <goal>deploy</goal> </goals> </execution> </executions> </plugin> .... <plugins> .... <build> .... <project> ConfigurationThe deploy goal may be configured in the <configuration> element using the following properties:
The deploy-file goalThe deploy-file goal is equivalent to the deploy goal except, that the deploy-file does not require a project descriptor file while the deploy goal does. In other words the deploy-file goal may used to upload any bundle file available to a Sling OBR server instance. UseThe deploy-file goal may only be used from the command line by explicitly calling it as in: $ mvn org.apache.sling:maven-sling-plugin:deploy-file -Dsling.file=<file> -Dobr=<url> Specifying the bundle file to upload with the sling.file property is required. ConfigurationThe deploy-file supports similar configuration parameters as the deploy goal with the exception of the skip parameter which makes no sense. In addition, all parameters must be specified on the command line by setting system properties. The bundleFileName parameter specified as the sling.file system property as well as the obr URL are required by the deploy-file goal.
Example: To deploy the bundle file someBundle.jar to the OBR running at http://obr.sample.org $ mvn org.apache.sling:maven-sling-plugin:deploy-file -Dsling.file=someBundle.jar -Dobr=http://obr.sample.org The assembly goalThe assembly goal is a Maven lifecycle goal which should be specified as <packaging in the project descriptor. UseTo use the deploy goal of the Maven Sling Plugin define the following elements in the <plugins> section of the POM: <?xml version="1.0" encoding="ISO-8859-1"?> <project> .... <packaging>assembly</packaging> .... <build> .... <plugins> .... <plugin> <groupId>org.apache.sling</groupId> <artifactId>maven-sling-plugin</artifactId> </plugin> .... <plugins> .... <build> .... <project> Configuration
NotesBundles contained in an Assembly Bundle are referred to by their bundle symbolic name and a version range. Depending on the versionPolicy applied to the bundle, this version range is specified such that only bundles with the same major and minor number as defined by the dependency are accepted or that any version equal to or higher to the specified dependency is accepted. Requiring the same major and minor version number is defined by the strict policy while accepting any version higher than or equal to the declared one is defined by the latest policy. The defualt policy is strict. The install-properties goalThis bundle generates the WEB-INF/sling_install.properties containing the referenced assemblies. UseTo use the install-properties goal of the Maven Sling Plugin define the following elements in the <plugins> section of the POM: <?xml version="1.0" encoding="ISO-8859-1"?> <project> .... <build> .... <plugins> .... <plugin> <groupId>org.apache.sling</groupId> <artifactId>maven-sling-plugin</artifactId> <executions> <execution> <id>install-properties</id> <goals> <goal>install-properties</goal> </goals> </execution> </executions> </plugin> .... <plugins> .... <build> .... <project> Configuration
NotesBundles listed in the sling_install.properties file are referred to by their bundle symbolic name and a version range. Depending on the versionPolicy applied to the bundle, this version range is specified such that only bundles with the same major and minor number as defined by the dependency are accepted or that any version equal to or higher to the specified dependency is accepted. Requiring the same major and minor version number is defined by the strict policy while accepting any version higher than or equal to the declared one is defined by the latest policy. The defualt policy is strict. |
Unsubscribe or edit your notifications preferences
