|
Page Edited :
SLINGxSITE :
Sling
Sling has been edited by Mike Mueller (May 24, 2009). Content:Maven Sling PluginThe Maven Sling Plugin provides a number of goals which may be of help while developping bundles for Sling. To run the plugin you need at least Maven 2.x and JDK 1.5 or higher. Maven Sling Plugin provides the following goals:
UsageYou should specify the version in your project's plugin configuration: <project> ... <build> <!-- To define the plugin version in your parent POM --> <pluginManagement> <plugins> <plugin> <groupId>org.apache.sling</groupId> <artifactId>maven-sling-plugin</artifactId> <version>2.0.5-incubator-SNAPSHOT</version> </plugin> ... </plugins> </pluginManagement> <!-- To use the plugin goals in your POM or parent POM --> <plugins> <plugin> <groupId>org.apache.sling</groupId> <artifactId>maven-sling-plugin</artifactId> <version>2.0.5-incubator-SNAPSHOT</version> </plugin> ... </plugins> </build> ... </project> For more information, see "Guide to Configuring Plug-ins"
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 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. It's also possible to HTTP PUT instead of POST for WebDAV. 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> ConfigurationThe install goal may be configured in the <configuration> element using the following properties:
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 uninstall goalThe uninstall goal uninstalls a bundle from a running sling instance, which may be located on a remote system. The plugin uninstalles a bundle via a HTTP POSTrequest. It's also possible to use HTTP DELETE instead of POST for WebDAV. UseTo use the uninstall 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>uninstall-bundle</id> <goals> <goal>uninstall</goal> </goals> </execution> </executions> </plugin> .... <plugins> .... <build> .... <project> ConfigurationThe uninstall goal may be configured in the <configuration> element using the following properties:
|
Unsubscribe or edit your notifications preferences
