2.2. Creating your extension project

Creating your extension project includes 2 mandatory steps:

Registering your extension manually

For Tomcat:

  1. Add the custom-extension.war file to the $PLATFORM_TOMCAT_HOME/webapps/ directory.

  2. Add the custom-extension-config.jar file to the $PLATFORM_TOMCAT_HOME/lib directory.

  3. Restart the server.

For JBoss:

  1. Create the custom-extension.war!/WEB-INF/jboss-deployment-structure.xml file with the following content that declares platform.ear as a dependency of the custom extension.

    
    <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
    <!-- This is the top level ear module, which contains all the classes in the EAR's lib folder     -->
        <deployment>
            <!-- This allows you to define additional dependencies, it is the same as using the Dependencies: manifest attribute -->
            <dependencies>
                <module name="deployment.platform.ear" export="true"/>
            </dependencies>
        </deployment>
    </jboss-deployment-structure>
  2. Add the custom-extension.war file to the $PLATFORM_JBOSS_HOME/standalone/deployments/ directory.

  3. Add the custom-extension-config.jar file to the $PLATFORM_JBOSS_HOME/standalone/deployments/platform.ear!/lib directory.

  4. Restart the server.

Registering your extension with script

To avoid manual registration which might cause errors (for example, invalid .xml files) in application.xml, eXo Platform provides the extension.sh script. It allows you to simplify your extension management in both Tomcat and JBoss EAP by copying all jars and wars of your extension in one step and uninstalling them without searching in the lib directory (more than 400 jars) and in the webapps directory (about 60 wars).

eXo Platform currently uses this script to automate the extension installation as described in Installing extensions.

Here are the steps you need to follow:

  1. Create a custom-extension folder in the $PLATFORM_HOME/extensions directory.

  2. Create 2 sub-folders, including lib and webapps in custom-extension.

  3. Copy custom-extension-config.jar, then paste it into the custom-extension/lib sub-folder.

  4. Copy custom-extension.war, then paste it into the custom-extension/webapps sub-folder.

  5. Run the following command to install the custom-extension project:

    • Linux/Mac: ./extension.sh --install custom-extension

    • Windows: extension.bat --install custom-extension

  6. Restart the server.

Tip

By running the extension.sh --help command, you will know how to use this script.

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus