My First Sling Application
Before proceeding you should have installed apache Sling and are comfortable running Sling and accessing it’s content repository via WebDAV. Because we are going to be building our Sling application, you should have check out the Sling source code:
svn co http://svn.apache.org/repos/asf/incubator/sling/trunk sling
Step inside the new created sling directory that we will henceforth refer to as the SLING_PROJECT_HOME.
Building Cleve’s Sling Demo
Unpack Cleve’s Demo zip file into the SLING_PROJECT_HOME/samples directory. You should see something like the following:
Step inside the cleve-demo directory and you’ll see:
From the command line above, you’ll see that we need to build and package the application using mvn package. Before we go ahead an install the our new application, ensure Sling is running and take a little look at the pom.xml file. Notice in the plug-in section this little piece of configuration:
<plugin> <groupId>org.apache.sling</groupId> <artifactId>maven-sling-plugin</artifactId> <executions> <execution> <id>install-bundle</id> <goals> <goal>install</goal> </goals> </execution> </executions> <configuration> <slingUrl>http://localhost:8080/system/console/install</slingUrl> <user>admin</user <password>admin</password> </configuration> </plugin>
This little maven sling plugin will take the application bundle built under the target directory as a result of mvn package and deploy it into a Sling instance. The actual Sling instance is determine by the SlingUrl defined with the XML above. And in true maven fashion, all this can be done with one command from a clean start with:
mvn clean install
Aftering installing the bundle, traverse to the sling console (http://localhost:8080/system/console/list) and see if the application has been successfully loaded into Sling. Can you see Cleve – First Sling Application below?


