Skip to content

Simple Sample Showing the Usage of Sling Feature Model Starter and its Maven Plugin

Notifications You must be signed in to change notification settings

schaefa/sling-fm-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample Feature Model Project

This project is using a HTL page together with a Sling Model to create a page. The instance is started with Sling 12 Feature Model Starter.

Build

Attention: The project needs to be fully build before it can be started (also after each change):

mvn clean install

Note: the reason for this is that the artifact and the FM is not installed before the install build cycle but the Sling instance is started before.

Launching

There are two ways to launch the project. Either use the Sling Starter Feature Maven Plugin in the launch profile or launch it directly with the Sling Feature Starter JAR file.

Launch the Project with the Maven Profile:

mvn install -P launch

Launch the Project with the Sling Feature Starter JAR file in the root folder of this project:

    java -jar repository/org/apache/sling/org.apache.sling.kickstart/0.0.1-SNAPSHOT/org.apache.sling.kickstart-0.0.1-SNAPSHOT.jar \
  -af target/slingfeature-tmp/feature-test.json

To Launch the same thing with a process in the background:

java -jar repository/org/apache/sling/org.apache.sling.kickstart/0.0.1-SNAPSHOT/org.apache.sling.kickstart-0.0.1-SNAPSHOT.jar \
  start \
  -af target/slingfeature-tmp/feature-test.json &

To stop the instance:

java -jar repository/org/apache/sling/org.apache.sling.kickstart/0.0.1-SNAPSHOT/org.apache.sling.kickstart-0.0.1-SNAPSHOT.jar \
  stop

Usage

The Sling instance is bound to port 8080 and can be accessed local instance.

The HTL Page is printing out some text and the current user which is obtained using a Sling Model.

About

Simple Sample Showing the Usage of Sling Feature Model Starter and its Maven Plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published