Fork me on GitHub

Plugin Documentation

Goals available for this plugin:

Goal Description
sling:deploy Deprecated. Use the OBR goals from the maven-bundle-plugin instead.
sling:deploy-file Deprecated. Use the OBR goals from the maven-bundle-plugin instead.
sling:fsmount Create OSGi configurations for the Apache Sling File System Resource Provider. In case a bundle file is supplied via AbstractFsMountMojo.bundleFileName the configuration for its initial content is created. Otherwise it tries to detect a FileVault content package layout starting at AbstractFsMountMojo.fileVaultJcrRootFile or the project's resource directories and potentially creates a configuration for each path in the package's filter.xml.
sling:fsunmount Remove OSGi configurations for the Apache Sling File System Resource Provider. In case a bundle file is supplied via AbstractFsMountMojo.bundleFileName the configuration for its initial content is created. Otherwise it tries to detect a FileVault content package layout starting at AbstractFsMountMojo.fileVaultJcrRootFile or the project's resource directories and potentially creates a configuration for each path in the package's filter.xml.
sling:generate-adapter-metadata Build adapter metadata (JSON) for the Web Console Plugin at /system/console/status-adapters and /system/console/adapters from classes annotated with adapter annotations.
sling:help Display help information on sling-maven-plugin.
Call mvn sling:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
sling:install Install the project's artifact to a running Sling instance (in case it is an OSGi bundle). It uses the first valid OSGi bundle file for deployment from the primary artifact and all secondary ones. For details refer to Bundle Installation. To install an arbitrary bundle not attached to the current Maven project use goal install-file.
sling:install-file 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 optionally classifier and packaging
  • artifact
  • bundleFileName
To install a bundle which has been built from the current Maven project rather use goal install. For details refer to Bundle Installation.
sling:uninstall Uninstall an OSGi bundle from a running Sling instance. For details refer to Bundle Uninstallation.
sling:validate Validate all JSON files of a project. It only ensures they are well-formed but not that they are valid against a certain schema.

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 3.3.1
JDK 8
Memory No minimum requirement.
Disk Space No minimum requirement.

Usage

You 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>sling-maven-plugin</artifactId>
          <version>3.0.2</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.apache.sling</groupId>
        <artifactId>sling-maven-plugin</artifactId>
        <version>3.0.2</version>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"