This is an old version of the Sling website, see the site conversion page for more info.
Apache Incubator

First Steps

A short recount on the first step for getting a running Sling instance after checking out the source from the SVN repository

Prerequisites

Before you begin, you should have installed the following tools on your system:

Getting a Running Instance

  1. Checkout Sling from the Repository
    $ svn checkout http://svn.apache.org/repos/asf/incubator/sling/trunk sling
    
  2. Enter the directory and do a full build and local install
    $ cd sling
    $ mvn install
    
  3. Enter the launcher/app directory and launch Sling for the first time
    $ cd launcher/app
    $ java -jar -Dsling.home=sling -Dorg.apache.sling.osgi.log.file= target/org.apache.sling.launcher.app-2.0.0-incubator-SNAPSHOT.jar
    

    Messages should now be printed to the console which is used as the "log file" because the org.apache.sling.osgi.log.file (see Logging) is defined empty indicating to use standard output as the log file. The sling.home property instructs Sling to use the sling directory in the current directory for its data store, which is the Apache Felix bundle archive, the Jackrabbit repository data and configuration. You may also specify another directory here, either a relative or absolute path name (See also Configuration for more information).
    After all messages have been printed you should now be able to contact the Sling Management Console by pointing your web browser at http://localhost:8080/sling. You will be prompted for a user name and password. Enter admin as both the user name and the passwort (this may be set on Configuration page later). From this console, you may manage the installed bundles, modify configuration objects, dump a configuration status and get some system information.
    To stop Sling, just hit Ctrl-C at the console or click the Stop button on the System Information page of the Sling Management Console. For the moment, we need a running Sling instance to continue.
    For now, you just have a bare running OSGi framework and the Sling Management Console. We will now install more bundles to get the real Sling instance.

  4. First we need some bundles from the Apache Felix Commons sub project. Open a new console, checkout these subprojects and install bundles in the running Sling instance as follows:
    $ svn checkout http://svn.apache.org/repos/asf/felix/trunk/commons felix-commons
    $ cd felix-commons
    $ for DIR in commons-io commons-fileupload commons-collections commons-beanutils commons-codec \
       cglib ; \
       do cd ${DIR} ; mvn package org.apache.sling:maven-sling-plugin:2.0.0-incubator-SNAPSHOT:install ; cd .. ; done
    

    On the Bundles page of the Sling Management Console you will see the additional bundles. All bundles are started with status Active.

  5. Now you are ready to install the Sling bundles. Go back to the Sling checkout directory and run a loop to install the bundles.
    $ cd ../..
    $ for DIR in commons/mime api jcr/api jcr/resource jcr/jackrabbit-server jcr/classloader \
        sling/core scripting/api scripting/resolver scripting/jsp scripting/jsp-taglib \
        sling/servlet-resolver; \
        do cd ${DIR} ; mvn package org.apache.sling:maven-sling-plugin:2.0.0-incubator-SNAPSHOT:install ; cd .. ; done
    

Congratulations ! You should now have a running Sling instance, which you may start playing around with.