Getting and Building Sling
A short recount on the first step for getting a running Sling instance after checking out the source from the SVN repository
Note that you don't have to build Sling yourself, if you don't need the bleeding-edge stuff you can get prebuilt binaries from the Downloads page.
Before you begin, you should have installed the following tools on your system:
- Java 5 or higher, Java 6 recommended
- Maven 2.0.7 (or later), Maven 2.0.9 recommended
Please refer to the Wiki for how to setup Eclipse 3.4 (Ganymede)
The full build process requires quite some resources, so you may run into limits. The following hints should show you what to setup before building Sling
Java Heap Space
- Problem – Build aborts with report of java.lang.OutOfMemoryError: Java heap space. This mostly happens while building the Jackrabbit Server module jcr/jackrabbit-server.
- Platforms – Windows XP, Mac OSX, OpenSolaris
- Fix – Set the a higher value for the maximum heap space for the build by setting or extending the MAVEN_OPTS environment variable:
Environment Variable Space
- Problem – Build aborts when trying to launch the integration tests with message
[INFO] Error while executing forked tests.; nested exception is org.apache.maven.surefire.booter.shade.org.codehaus.plexus.util.cli.CommandLineException: Error setting up environmental variables
error=12, Not enough space
- Platform – OpenSolaris
- Fix – This problem is caused by missing swap space. When running the integration tests in the launchpad/testing modules, a process is launched by calling the exec system call. This copies the process (copy-on-write, though) and thus allocates as much virtual memory as is owned by the parent process. This may fail if swap space is exhausted.
See also MavenTipsAndTricks.
Many of the Sling modules have been released into the Apache Incubator Maven 2 repository. This repository is not visible by default to Maven 2. To enable its use, it is easiest if you configure it into your local maven settings found in $HOME/.m2/settings.xml by default:
<name>Apache Incubating Repository</name>
<name>Apache Incubating Plugin Repository</name>
Getting a Running Instance
- Checkout Sling from the Repository.
$ svn checkout http://svn.apache.org/repos/asf/incubator/sling/trunk sling
- Enter the directory and do a full build and local install (below are unix/linux commands, slightly different under windows)
$ cd sling
$ export MAVEN_OPTS=-Xmx256m
$ mvn -s /dev/null clean install
- Enter the launchpad/app directory and launch Sling for the first time
$ cd launchpad/app
$ java -jar target/org.apache.sling.launchpad.app-2.0.0-incubator-SNAPSHOT.jar -c sling -f -
Messages should now be printed to the console which is used as the "log file" because the -f command line option is set to - indicating to use standard output as the log file. The -c sling command line option 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 open the Sling Management Console by pointing your web browser at http://localhost:8080/system/console. You will be prompted for a user name and password. Enter admin as both the user name and the password (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.
Congratulations ! You should now have a running Sling instance, which you may start playing around with.