sling:install-file
Full name:
org.apache.sling:sling-maven-plugin:3.0.4:install-file
Description:
Install an OSGi bundle from a given file path or Maven coordinates (resolved from the repository) to a running Sling instance. One of the following parameter sets are used to determine the bundle to install (evaluated in the given order):
groupId,artifactId,version, and optionallyclassifierandpackagingartifactbundleFileName
Attributes:
- The goal is not marked as thread-safe and thus does not support parallel builds.
Required Parameters
| Name | Type | Since | Description |
|---|---|---|---|
<slingUrl> |
URI |
- |
The URL of the running Sling instance.
The default is only useful for WebConsole deployment. For WebDAV deployment it is recommended to include the Sling Simple WebDAV servlet root, for instance http://localhost:8080/dav/default/libs/sling/install. Omitting the Default: http://localhost:8080/system/consoleUser Property: sling.url |
Optional Parameters
| Name | Type | Since | Description |
|---|---|---|---|
<artifact> |
String |
- |
A string of the form groupId:artifactId:version[:packaging[:classifier]]. Takes precedence over bundleFileName.User Property: sling.artifact |
<artifactId> |
String |
- |
The artifactId of the artifact to install. Takes precedence over artifact and bundleFileName.User Property: sling.artifactId |
<bundleFileName> |
File |
- |
The path of the bundle file to install. Is only effective if artifact is not determined via some other way (Maven coordinates). Default: ${project.build.directory}/${project.build.finalName}.jarUser Property: sling.file |
<bundleStart> |
boolean |
- |
Whether to start the uploaded bundle or not. Only applies when POSTing to Felix Web Console Default: trueUser Property: sling.bundle.start |
<bundleStartLevel> |
String |
- |
The start level to set on the installed bundle. If the bundle is already installed and therefore is only updated this parameter is ignored. The parameter is also ignored if the running Sling instance has no StartLevel service (which is unusual actually). Only applies when POSTing to Felix Web Console. Default: 20User Property: sling.bundle.startlevel |
<classifier> |
String |
- |
The classifier of the artifact to install User Property: sling.classifier |
<deploymentMethod> |
BundleDeploymentMethod |
- |
Bundle deployment method. One of the following three values are allowed
usePut. If nothing is set the default is either WebConsole or WebDAV (when usePut is true).User Property: sling.deploy.method |
<failOnError> |
boolean |
- |
Determines whether or not to fail the build if the HTTP POST or PUT returns an non-OK response code. Default: trueUser Property: sling.failOnError |
<groupId> |
String |
- |
The groupId of the artifact to install. Takes precedence over artifact and bundleFileName.User Property: sling.groupId |
<httpConnectTimeoutSec> |
int |
3.0.0 |
HTTP connection timeout (in seconds). Determines the timeout until a new connection is fully established. This may also include transport security negotiation exchanges such as SSL or TLS protocol negotiation).Default: 10User Property: sling.httpConnectTimeoutSec |
<httpResponseTimeoutSec> |
int |
3.0.0 |
HTTP response timeout (in seconds). Determines the timeout until arrival of a response from the opposite endpoint. Default: 60User Property: sling.httpResponseTimeoutSec |
<mimeType> |
String |
- |
The content type / mime type used for WebDAV or Sling POST deployment. Default: application/java-archiveUser Property: sling.mimeType |
<mountByFS> |
boolean |
- |
Whether to add (for install)/remove (for uninstall) the mapping for the Apache Sling File System Resource Provider for the bundle's initial content. This parameter must not be true with bundles resolved from the Maven repository.Default: falseUser Property: sling.mountByFS |
<packaging> |
String |
- |
The packaging of the artifact to install Default: jarUser Property: sling.packaging |
<password> |
String |
- |
The password to authenticate at the running Sling instance. Default: adminUser Property: sling.password |
<refreshPackages> |
boolean |
- |
Whether to refresh the packages after installing the uploaded bundle. Only applies when POSTing to Felix Web Console Default: trueUser Property: sling.refreshPackages |
<slingConsoleUrl> |
URI |
- |
The WebConsole URL of the running Sling instance. This is required for file system provider operations. If not configured the value of slingUrl is used. User Property: sling.console.url |
<slingUrlSuffix> |
String |
- |
An optional url suffix which will be appended to the sling.url for use as the real target url. This allows to configure different target URLs in each POM, while using the same common sling.url in a parent POM (eg. sling.url=http://localhost:8080 and sling.urlSuffix=/project/specific/path). This is typically used in conjunction with WebDAV or SlingPostServlet deployment methods.User Property: sling.urlSuffix |
<usePut> |
boolean |
- |
Deprecated. Use deploymentMethod instead.If a PUT via WebDAV should be used instead of the standard POST to the Felix Web Console. In the uninstall goal, a HTTP DELETE will be used.Default: falseUser Property: sling.usePut |
<user> |
String |
- |
The user name to authenticate at the running Sling instance. Default: adminUser Property: sling.user |
<version> |
String |
- |
The version of the artifact to install. Takes precedence over artifact and bundleFileName.User Property: sling.version |
Parameter Details
<artifact>
groupId:artifactId:version[:packaging[:classifier]]. Takes precedence over bundleFileName.- Type:
java.lang.String - Required:
No - User Property:
sling.artifact
<artifactId>
artifact and bundleFileName.- Type:
java.lang.String - Required:
No - User Property:
sling.artifactId
<bundleFileName>
- Type:
java.io.File - Required:
No - User Property:
sling.file - Default:
${project.build.directory}/${project.build.finalName}.jar
<bundleStart>
- Type:
boolean - Required:
No - User Property:
sling.bundle.start - Default:
true
<bundleStartLevel>
- Type:
java.lang.String - Required:
No - User Property:
sling.bundle.startlevel - Default:
20
<classifier>
- Type:
java.lang.String - Required:
No - User Property:
sling.classifier
<deploymentMethod>
- WebConsole, uses the Felix Web Console REST API for deployment (HTTP POST). This is the default. Make sure that
slingUrlpoints to the Felix Web Console in that case. - WebDAV, uses WebDAV for deployment (HTTP PUT). Make sure that
slingUrlpoints to the entry path of the Sling WebDAV bundle (defaults to/dav/defaultin the Sling starter). Issues a HTTP Delete for the uninstall goal. - SlingPostServlet, uses the Sling Post Servlet for deployment (HTTP POST). Make sure that
slingUrlpoints a path which is handled by the Sling POST Servlet (usually below regular Sling root URL).
usePut. If nothing is set the default is either WebConsole or WebDAV (when usePut is true).- Type:
org.apache.sling.maven.bundlesupport.deploy.BundleDeploymentMethod - Required:
No - User Property:
sling.deploy.method
<failOnError>
- Type:
boolean - Required:
No - User Property:
sling.failOnError - Default:
true
<groupId>
artifact and bundleFileName.- Type:
java.lang.String - Required:
No - User Property:
sling.groupId
<httpConnectTimeoutSec>
SSL or TLS protocol negotiation).- Type:
int - Since:
3.0.0 - Required:
No - User Property:
sling.httpConnectTimeoutSec - Default:
10
<httpResponseTimeoutSec>
- Type:
int - Since:
3.0.0 - Required:
No - User Property:
sling.httpResponseTimeoutSec - Default:
60
<mimeType>
- Type:
java.lang.String - Required:
No - User Property:
sling.mimeType - Default:
application/java-archive
<mountByFS>
true with bundles resolved from the Maven repository.- Type:
boolean - Required:
No - User Property:
sling.mountByFS - Default:
false
<packaging>
- Type:
java.lang.String - Required:
No - User Property:
sling.packaging - Default:
jar
<password>
- Type:
java.lang.String - Required:
No - User Property:
sling.password - Default:
admin
<refreshPackages>
- Type:
boolean - Required:
No - User Property:
sling.refreshPackages - Default:
true
<slingConsoleUrl>
- Type:
java.net.URI - Required:
No - User Property:
sling.console.url
<slingUrl>
The default is only useful for WebConsole deployment.
For WebDAV deployment it is recommended to include the Sling Simple WebDAV servlet root, for instance http://localhost:8080/dav/default/libs/sling/install. Omitting the dav/default segment can lead to conflicts with other servlets.
- Type:
java.net.URI - Required:
Yes - User Property:
sling.url - Default:
http://localhost:8080/system/console
<slingUrlSuffix>
sling.url for use as the real target url. This allows to configure different target URLs in each POM, while using the same common sling.url in a parent POM (eg. sling.url=http://localhost:8080 and sling.urlSuffix=/project/specific/path). This is typically used in conjunction with WebDAV or SlingPostServlet deployment methods.- Type:
java.lang.String - Required:
No - User Property:
sling.urlSuffix
<usePut>
Use
deploymentMethod instead.uninstall goal, a HTTP DELETE will be used.- Type:
boolean - Required:
No - User Property:
sling.usePut - Default:
false
<user>
- Type:
java.lang.String - Required:
No - User Property:
sling.user - Default:
admin
<version>
artifact and bundleFileName.- Type:
java.lang.String - Required:
No - User Property:
sling.version
