There instructions cover the steps for adding a custom module to an existing website project.
- A parent pom and webapp. See Setting up a Magnolia website project.
Create the module
When you have an existing Magnolia project (parent pom and webapp) you need to move inside the directory that contains your parent pom.
From the command line run:
1: An archetype to create STK Theme modules
2: An archetype to create a Magnolia project (a parent pom and a webapp)
3: An archetype to create basic Magnolia modules
4: An archetype to create a Magnolia module to be hosted on the Magnolia Forge
5: An archetype to create Magnolia modules using Blossom
Each archetype can have it's own set of versions.
Choose info.magnolia.maven.archetypes:magnolia-module-archetype version:
Define the project:
It can be helpful to align the project version with Magnolia version.
|com.mycompany.templates (press enter key to accept)|
The magnolia-version is equivalent to core version. This can be different than bundle-version.
This name will show up in the configuration tree. Avoid using the word "module" here because it's redundant.
For every additional module added to the project you will find an entry in the parent pom.
- There can be a discrepancy between bundle version and core version.
info.magnolia.bundle.magnolia-bundle-parentpom for the
magnoliaVersion, which ultimately determines the version of core.
Update your module pom so that it does not explicitly depend on a version of core. Or even remove it if you do not have a code dependency on core.
By default the archetype creates a dependency on core with a specific version number.
- Having a descriptor dependency on core is often not required.
- There is already a transitive dependency.
- The module does not make some configuration change to another module.