Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When you start Magnolia, the system identifies available modules by locating each module's descriptor file.

 


Table of Contents

Benefits of a module descriptor

...

Module naming

For each module you have to provide:

  1. artifactId and groupId to the identify the Maven artifact
  2. Name of the module descriptor file.
  3. <name> of the module in the module descriptor file.

There are no strict naming conventions. You should give a name that reflects the purpose of the module. The name may also contain the name of your company.

Depending on the module purpose it might be a good idea to use the same value for the artifact ID and module name.

It is definitively good practice to name the module descriptor file by the pattern <module-name>.xml.

Example:

  • Module name: Social Media Hub
  • Artifact ID: social-media-hub
  • Group ID: com.tinext.magnolia (contains the name of the creator Tinext.com)
  • Module descriptor file: social-media-hub.xml

Module versions

Include Page
_Module versions
_Module versions

Module dependencies

You can define runtime or install time dependencies (not build dependencies). If you define a dependency on a module, then this module will be installed and started before your module. A dependency can be optional. Optional in this context means that if an optional module is not present, installation will proceed, but if the optional module is present, this module will be installed first. The dependencies could look like this:

Code Block
<dependencies>
   <dependency>
      <name>core</name>
      <version>3.6.0/*</version>
   </dependency>
   <!--  in case cache module is present, 
   make sure we install after so we can add a bypass -->
   <dependency>
      <name>cache</name>
      <version>3.6.0/*</version>
      <optional>true</optional>
   </dependency>
</dependencies>
Include Page
_Module dependencies define module loading order
_Module dependencies define module loading order

Workspaces

Workspaces can be defined in the module descriptor. If necessary Magnolia initializes these workspaces before the installation starts. As an example look at the data module:

Code Block
xml
xml
  <repositories>
    <repository>
      <name>magnolia</name>
      <workspaces>
        <workspace>data</workspace>
      </workspaces>
      <nodeTypeFile>/mgnl-nodetypes/magnolia-module-data-nodetypes.xml</nodeTypeFile>
    </repository>
  </repositories>

Under the hood, these repository workspaces are registered and initialized by the 

Javadoc
info.magnolia.module.delta.SetupModuleRepositoriesTask
rangeHigherVersion5.5
classNameinfo.magnolia.module.delta.SetupModuleRepositoriesTask
renderTypeasynchronous
 when the module is installed.