This document provides an introduction to working with WebSight projects. It explains how to configure, build and run a new project using Maven Archetype. It also describes the contents of the project build and runtime files.
Although the specific contents of your project may vary depending on your needs, the sample project described on this page is a useful starting-point for running Web applications using WebSight CMS.
You can check your Java version in most environments with:
Check your Maven version with:
Generate a project
To create a new project, first open a command prompt and cd to the directory where you want to store your project.
Next, use a Maven command to create your project, being sure to declare the desired parameters properly.
- Use the groupId, artifactId, and version parameters to declare Maven artifacts for your project.
- Use projectName, projectId and package parameters to define technical requirements (such as application resources paths and Docker image names) and the root package for Java code.
- Use the archetypeVersion parameter to set the archetype version you want to use. You can check the latest version here.
- Use the cmsVersion parameter to specify the WebSight CMS version that the project should use. Check the WebSight Release Notes to find the latest available version.
mvn archetype:generate \ -DarchetypeGroupId=pl.ds.websight \ -DarchetypeArtifactId=websight-cms-ce-project-archetype \ -DarchetypeVersion=3 \ -DgroupId=my.groupId \ -DartifactId=my-artifactId \ -Dversion=1.0.0-SNAPSHOT \ -DprojectName="Example Project" \ -DprojectId=example-project \ -Dpackage=com.example.project \ -DcmsVersion=1.23.0
The above command creates a project with the following structure:
The contents of the project structure we generated above are an example of what you'd typically include when creating a project for a Web application using WebSight CMS.
Note in particular the following modules:
application- components code and scripts delivered as OSGi bundles
backend- CMS elements (pages, templates, components, etc.), Java models and services
frontend- frontend project bundled by webpack
content- initial content as a JCR vault module (content_package)
distribution- project distribution - Sling feature model and optionally Docker images
tests- tests used to validate the distribution
content- content for end-to-end tests
end-to-end- end-to-end tests
It is important to note that the project contains built-in server definitions and configurations. The
distribution module is responsible for bundling the application based on the configurations and WebSight CMS modules using
Sling Feature Model. Optionally it also prepares the Docker images (however, Docker is out of scope of this guide).
Build the application
To build the project, use the Maven command:
Add e2e profile to execute end-to-end tests:
You should see successful end-to-end test execution in the log:
Execution should end with a successful build message:
Run the instance
Once your project build is complete, you can start a local instance by running the following command:
README.md for additional details about the runtime environment.
After login, you will be redirected to the Spaces list. In WebSight CMS content is organized in Spaces. The Spaces list shows you the generated application and its associated content using the
After clicking on the Space name, the Pages dashboard opens with one page delivered in the initial content. You can manage your pages here and navigate to the Assets dashboard (to manage Assets) or open the Page editor to edit page content from within the CMS:
In the Right top corner, you will find an Admin tools menu with links to administration tools. Or, the Admin dashboard can be accessed directly using the following link:
Now that you know how to set up a new project using WebSight CMS, consider learning more about the following topics: