Page History
...
Table of Contents | ||
---|---|---|
|
Introduction
Using Maven to create a webapp allows you to customize your webapp through the POM files, which can be tracked with a version control system like Git . A tailored webapp makes building and deploying faster and has a positive impact on the performance of your instances.
...
Creating the webapp skeleton
Start by running the Magnolia Maven archetype command to create a skeleton of your webapp.
...
In the next two steps, you edit the two pom.xml
files.
Editing the parent POM
In the
dependencyManagement
section, remove the Option A.Uncomment the Option B.
- In the
repositories
section, uncomment the repository with the idmagnolia.enterprise.releases
.
...
Code Pro | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Editing the webapp POM
In the webapp POM file, modify the dependencies
section.
- Uncomment the option iv.
- Remove the other options (i, ii and iii).
Exclude the Content Translation Support and Marketing Tags modules.
To exclude them, you have to add theexclusions
section with anexclusion
tag for each module. This should be done within thepom
typedependency
of themagnolia-enterprise-pro-webapp
.
(See also https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html.)
Here is the result:Code Pro language xml title custom-ee-pro-project/custom-ee-pro-project-webapp/pom.xml collapse true url https://git.magnolia-cms.com/projects/DOCUMENTATION/repos/custom-ee-pro-project/raw/custom-ee-pro-project-webapp/pom.xml?at=master Note When excluding a module from a webapp, you must check whether other modules, which are still part of the webapp, do not have runtime dependencies to the module you exclude. At the latest, you can discover any unsatisfied runtime dependency during the startup of your Magnolia webapp. Runtime dependencies are defined in the Magnolia Module descriptors.
Adding further resources
The skeleton produced by the Maven archetype has several folders which we have not used so far. This concerns especially the src
folder in the webapp
subdirectory. In the context of this tutorial page it is the custom-ee-pro-project/custom-ee-pro-project-webapp/src
folder. This folder has the following subfolders:
...
Info |
---|
The |
Customizing the magnolia.properties
file
In this step, you add the (default) magnolia.properties
file and customize the magnolia.resources.dir
property in it.
...
In the next and final step you build the webapp.
Building the project
First, change into the root directory of your project. Then, run the mvn
command with the tasks clean
and install
:
...