Sling, Felix & oak



Open source Java based Web framework designed to create content-centric applications on top of a Java Content Repository.

Source Location (Subversion):


Apache Felix is an implementation of the OSGi Framework and Service platform.

Source Location (Subversion):

Source Location (Subversion):


Jackrabbit Oak is a Java Content Repository implementation designed to be the foundation for modern web applications.



Subversion is a source control repository.


In subversion, every revision is a commit to the repository.  A commit is a collection changes including files and/or folders.

Subversion commands

Checkout - svn co

svn co http://svnserver/svn-repo/project-path - downloads ("checks out") the latest files from that path

svn -r {revision-id} co {url} - checks out a specific revision


Status - svn status

svn status - lists local changes

svn diff - shows diff of local changes vs. checked out version

SVN Project Structure

/project-name/trunk - latest unstable changes


/project-name/branches - branched changes of the code

e.g. Oak v1.2.x code is committed to oak/branches/1.2


/project-name/tags - released versions of code

If you are looking for a specific version of the project code.

e.g. Oak 1.2.7 code can be found under oak/tags/1.2.7 


Check out Apache Sling Event Support bundle version 3.74 to the current working directory:

svn co

project name

Tags folder


released versions

tag folder

of bundle




Apache felix svn repo

Apache Felix Project has a releases folder instead of tags

Modifying Code

Maven DEtails

Maven settings configuration:

Specifies which remote maven repositories to use.


Local Maven Repository:


Dependency jar files are downloaded here.


Project configuration:

Build details - project dependencies, plugins, etc.

Maven Commands

Run these commands where the pom.xml file is located.


mvn package

builds the project under the target directory of the project


mvn install

builds the project under the target

directory and copies the bundle to the local maven repostory under {user-home}/.m2/repository


mvn clean

Deletes files from the target folder.


using Eclipse

Configure Maven Installation in Eclipse

Preferences => Maven => Installations => Add...

using Eclipse

Import the existing maven project from the file system

(Right click) Project Explorer => Import => Import... => Maven

=> Existing Maven Projects

using Eclipse

Select the project path

Browse... => Select Path => Finish

using Eclipse

Project would automatically build and download dependencies.  When it is done it looks like this:

using Eclipse

Search for the source files from stack traces in the logs.

Ctrl+Shift+T (windows) or Cmd+shift+T (Mac) to open the dialog

using Eclipse

Make the desired changes and build.

Right-click Project => Run As => Maven install

using Eclipse

Configure a custom build configuration

Right-click Project => Run As => Run Configurations... =>

Double-click "Maven Build"

using Eclipse

Modify the project version

Open the pom.xml file => edit the <version> by appending some identifying info "-cc#####"

using Eclipse

Run mvn clean package via a custom build configuration

Create the build config and click Run

Deploying the bundle to sling

Leverage the Sling JCR Installer


Use curl to install the bundle to the Sling server.

curl -v -u user:pass -T path/to/file.jar http://host:port/path/to/install/


curl -v -u admin:admin -T target/ http://localhost:4506/libs/system/install/

Apache Felix Console

In the Apache Felix bundles console:


we can see that our bundle is installed

Building Apache Sling projects from source.

By andrewmkhoury

Building Apache Sling projects from source.

Building Apache Sling projects from source.

  • 1,062
Loading comments...