Deploying an OSGI module in Digital Experience Manager

  Written by The Jahia Team
   Estimated reading time:

Deploying an OSGi module is relatively straightforward. Once you have the generated JAR file (in a Maven project it is generated in the target subdirectory), you can simply deploy it to the tomcat/webapps/ROOT/WEB-INF/var/modules directory of your Digital Experience Manager installation. This can be done whether the server is running or not, it will be picked up and deployed by the server. Every resource in the module (provided it deployed without any errors) will be immediately accessible, including any libraries that have been embedded in the package. If you have declared services in your bundle, they will also be available upon deployment.

Deploying using the Jahia Maven Plugin

During development, you will probably want to deploy and redeploy your module often, so using the jahia:deploy goal makes this a lot easier to do often. You just need to setup a profile with the location and type of your target server, such as in the following example:


You can then simply compile and deploy your module using the following command line:

mvn clean install jahia:deploy -P jahia-7.0-tomcat

Un-deploying/re-deploying a module

If you are using the Jahia Maven Plugin you can simply redeploy a module from the project using the jahia:deploy goal again. Upon deployment in the WEB-INF/var/modules directory, Digital Experience Manager will automatically undeploy the old version and deploy the new one.

Alternatively you can also use the administration’s manage modules UI to undeploy the module.