blob: 92c259a090d71d27efe9876f6a39830a3d0d2cda [file] [log] [blame]
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia Site Renderer 1.8.1 at 2019-06-06
| Rendered using Apache Maven Fluido Skin 1.6
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="Date-Revision-yyyymmdd" content="20190606" />
<meta http-equiv="Content-Language" content="en" />
<title>Apache Sling Maven Plugin &#x2013; Plugin Documentation</title>
<link rel="stylesheet" href="./css/apache-maven-fluido-1.6.min.css" />
<link rel="stylesheet" href="./css/site.css" />
<link rel="stylesheet" href="./css/print.css" media="print" />
<script type="text/javascript" src="./js/apache-maven-fluido-1.6.min.js"></script>
</head>
<body class="topBarDisabled">
<div class="container-fluid">
<div id="banner">
<div class="pull-left"><div id="bannerLeft"><h2>Apache Sling Maven Plugin</h2>
</div>
</div>
<div class="pull-right"></div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li id="publishDate">Last Published: 2019-06-06<span class="divider">|</span>
</li>
<li id="projectVersion">Version: 2.4.2</li>
</ul>
</div>
<div class="row-fluid">
<div id="leftColumn" class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Overview</li>
<li><a href="index.html" title="Introduction"><span class="none"></span>Introduction</a> </li>
<li class="active"><a href="#"><span class="none"></span>Goals</a>
</li>
<li class="nav-header">Project Documentation</li>
<li><a href="project-info.html" title="Project Information"><span class="icon-chevron-right"></span>Project Information</a> </li>
<li><a href="project-reports.html" title="Project Reports"><span class="icon-chevron-down"></span>Project Reports</a>
<ul class="nav nav-list">
<li><a href="surefire-report.html" title="Surefire Report"><span class="none"></span>Surefire Report</a> </li>
<li><a href="jira-report.html" title="JIRA Report"><span class="none"></span>JIRA Report</a> </li>
<li class="active"><a href="#"><span class="none"></span>Plugin Documentation</a>
</li>
</ul>
</li>
</ul>
<hr />
<div id="poweredBy">
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /></a>
</div>
</div>
</div>
<div id="bodyColumn" class="span10" >
<div class="section">
<h2><a name="Plugin_Documentation"></a>Plugin Documentation</h2><a name="Plugin_Documentation"></a>
<p>Goals available for this plugin:</p>
<table border="0" class="table table-striped">
<tr class="a">
<th>Goal</th>
<th>Description</th></tr>
<tr class="b">
<td><a href="deploy-mojo.html">sling:deploy</a></td>
<td>Deploy a JAR representing an OSGi Bundle to a Sling OSGi Bundle
Repository. This method posts the bundle built by maven to the OSGi
Bundle Repository. The plugin uses a <em>multipart/format-data</em>
POST request to just post the file to the URL configured in the
<code>obr</code> property.</td></tr>
<tr class="a">
<td><a href="deploy-file-mojo.html">sling:deploy-file</a></td>
<td>Deploy a JAR representing an OSGi Bundle to a Sling OSGi Bundle
Repository. This method posts the bundle referenced via
<code>sling.file</code> to an OSGi Bundle Repository accepting the
bundle. The plugin uses a <em>multipart/format-data</em> POST
request to just post the file to the URL configured in the
<code>obr</code> property.</td></tr>
<tr class="b">
<td><a href="fsmount-mojo.html">sling:fsmount</a></td>
<td>Creates OSGi configurations for the <a
href="https://sling.apache.org/documentation/bundles/accessing-filesystem-resources-extensions-fsresource.html">Apache
Sling File System Resource Provider</a>.</td></tr>
<tr class="a">
<td><a href="fsunmount-mojo.html">sling:fsunmount</a></td>
<td>Removes OSGi configurations for the <a
href="https://sling.apache.org/documentation/bundles/accessing-filesystem-resources-extensions-fsresource.html">Apache
Sling File System Resource Provider</a>.</td></tr>
<tr class="b">
<td><a href="generate-adapter-metadata-mojo.html">sling:generate-adapter-metadata</a></td>
<td>Build <a
href="http://sling.apache.org/documentation/the-sling-engine/adapters.html">adapter
metadata (JSON)</a> for the Web Console Plugin at
<code>/system/console/status-adapters</code> and
<code>/system/console/adapters</code> from classes annotated with
<a
href="http://svn.apache.org/viewvc/sling/trunk/tooling/maven/adapter-annotations/">adapter
annotations</a>.</td></tr>
<tr class="a">
<td><a href="help-mojo.html">sling:help</a></td>
<td>Display help information on sling-maven-plugin.<br />
Call <code>mvn sling:help -Ddetail=true
-Dgoal=&lt;goal-name&gt;</code> to display parameter details.</td></tr>
<tr class="b">
<td><a href="install-mojo.html">sling:install</a></td>
<td>Install an OSGi bundle to a running Sling instance. The plugin
places an HTTP POST request to <a
href="http://felix.apache.org/documentation/subprojects/apache-felix-web-console/web-console-restful-api.html#post-requests">Felix
Web Console</a>. It's also possible to HTTP PUT instead of POST
leveraging the <a
href="http://sling.apache.org/documentation/development/repository-based-development.html">WebDAV
bundle from Sling</a>. Since version 2.1.8 you can also leverage
the the <a
href="http://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html">Sling
POST servlet</a> for that The chosen method depends on the
parameter <code>deploymentMethod</code>. <br />
<p><strong>Intermediate Node Creation</strong></p>
<p>For all <code>deploymentMethod</code>s except WebDAV the bundle
is not directly deployed within the OSGi container, but rather
being uploaded to the JCR and from there on being picked up by the
<a
href="https://sling.apache.org/documentation/bundles/jcr-installer-provider.html">JCR
Installer Provider</a> asynchronously, which takes care of
deploying it in the OSGi container. For both other deployment
methods, intermediate nodes (i.e. inexisting parent nodes) are
automatically created. The primary type of those intermediate nodes
depend on the deployment method.</p>
<ul>
<li>WebDAV, uses the configured collection node type, by default
<code>sling:Folder</code> (see also <a
href="https://sling.apache.org/documentation/development/repository-based-development.html">WebDAV
Configuration</a>)</li>
<li>SlingPostServlet, uses internally
<code>ResourceResolverFactory.create(...)</code> without setting
any <code>jcr:primaryType</code>. Therefore the
<code>JcrResourceProviderFactory</code> will call
<code>Node.addNode(String relPath)</code> which determines a
fitting node type automatically, depending on the parents node type
definition (see <a
href="http://www.day.com/specs/jsr170/javadocs/jcr-2.0/javax/jcr/Node.html#addNode%28java.lang.String%29">Javadoc</a>).
So in most of the cases this should be a <code>sling:Folder</code>,
as this is the first allowed child node definition in
<code>sling:Folder</code>. This only may differ, if your existing
parent node is not of type <code>sling:Folder</code> itself.</li>
</ul></td></tr>
<tr class="a">
<td><a href="install-file-mojo.html">sling:install-file</a></td>
<td>Install an OSGi bundle to a running Sling instance.</td></tr>
<tr class="b">
<td><a href="uninstall-mojo.html">sling:uninstall</a></td>
<td>Uninstall an OSGi bundle from a running Sling instance. The plugin
places by default an HTTP POST request to <a
href="http://felix.apache.org/documentation/subprojects/apache-felix-web-console/web-console-restful-api.html#post-requests">Felix
Web Console</a> to uninstall the bundle. It's also possible to use
HTTP DELETE leveraging the <a
href="http://sling.apache.org/documentation/development/repository-based-development.html">WebDAV
bundle from Sling</a>. or the <a
href="http://sling.apache.org/documentation/bundles/manipulating-content-the-slingpostservlet-servlets-post.html">Sling
POST servlet</a> to uninstall the bundle. The chosen method depends
on the parameter <code>deploymentMethod</code>.</td></tr>
<tr class="a">
<td><a href="validate-mojo.html">sling:validate</a></td>
<td>The <code>validate</code> goal checks the JSON code of a bundle.</td></tr></table>
<div class="section">
<h3><a name="System_Requirements"></a>System Requirements</h3><a name="System_Requirements"></a>
<p>The following specifies the minimum requirements to run this Maven plugin:</p>
<table border="0" class="table table-striped">
<tr class="a">
<td>Maven</td>
<td>3.0.4</td></tr>
<tr class="b">
<td>JDK</td>
<td>1.8</td></tr>
<tr class="a">
<td>Memory</td>
<td>No minimum requirement.</td></tr>
<tr class="b">
<td>Disk Space</td>
<td>No minimum requirement.</td></tr></table></div>
<div class="section">
<h3><a name="Usage"></a>Usage</h3><a name="Usage"></a>
<p>You should specify the version in your project's plugin configuration:</p>
<div class="source"><pre class="prettyprint">&lt;project&gt;
...
&lt;build&gt;
&lt;!-- To define the plugin version in your parent POM --&gt;
&lt;pluginManagement&gt;
&lt;plugins&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.apache.sling&lt;/groupId&gt;
&lt;artifactId&gt;sling-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;2.4.2&lt;/version&gt;
&lt;/plugin&gt;
...
&lt;/plugins&gt;
&lt;/pluginManagement&gt;
&lt;!-- To use the plugin goals in your POM or parent POM --&gt;
&lt;plugins&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.apache.sling&lt;/groupId&gt;
&lt;artifactId&gt;sling-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;2.4.2&lt;/version&gt;
&lt;/plugin&gt;
...
&lt;/plugins&gt;
&lt;/build&gt;
...
&lt;/project&gt;
</pre></div>
<p>For more information, see <a class="externalLink" href="http://maven.apache.org/guides/mini/guide-configuring-plugins.html">&quot;Guide to Configuring Plug-ins&quot;</a></p></div></div>
</div>
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row-fluid">
<p>Copyright &copy;2007&#x2013;2019
<a href="https://www.apache.org/">The Apache Software Foundation</a>.
All rights reserved.</p>
</div>
</div>
</footer>
</body>
</html>