Creating a new module
Using a Maven Archetype
We provide a Maven archetype to get started quickly with a new project. The steps below guide you through the process of creating a new project.
- Create a new project using a Maven Archetype:
mvn archetype:generate -Dfilter=org.jahia.archetypes:
- Select the required archetype, e.g.:
2: remote -> org.jahia.archetypes:jahia-module-archetype (Archetype for creating a new module project to be run on a Jahia server)
- Chose the latest archetype version available from the list
- Enter project metadata and confirm
- Change into project directory and build using:
mvn clean install
You can then open the Maven project in your favorite IDE and start building your Jahia OSGi module.
OSGi enables you to hot deploy packaged modules at runtime. Deploy-free coding builds on top of OSGi's capabilities and makes it possible to use changes made in file's source code without needing any redeployment. Deploy-free coding only requires an initial deployment using Jahia's Maven plugin.
When releasing modules, it is recommended that you remove the Jahia-Source-Folders configuration attribute from the Felix Maven Bundle plugin configuration. This is just to avoid any potential lookups in case the source folders also exist on the server. It will also prevent unnecessary file lookups.