Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: DEV-1166, retitle page

...

Table of Contents
maxLevel2

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

  1. In the dependencyManagement section, remove the Option A.

  2. Uncomment the Option B.

  3. In the repositories section, uncomment the repository with the id magnolia.enterprise.releases.

...

Code Pro
languagexml
titlecustom-ee-pro-project/pom.xml
collapsetrue
urlhttps://git.magnolia-cms.com/projects/DOCUMENTATION/repos/custom-ee-pro-project/raw/pom.xml?at=master

Editing the webapp POM

In the webapp POM file, modify the dependencies section.

  1. Uncomment the option iv.
  2. Remove the other options (i, ii and iii).
  3. Exclude the Content Translation Support and Marketing Tags modules.
    To exclude them, you have to add the exclusions section with an exclusion tag for each module. This should be done within the pom type dependency of the magnolia-enterprise-pro-webapp.
    (See also https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html.)

    Here is the result:

    Code Pro
    languagexml
    titlecustom-ee-pro-project/custom-ee-pro-project-webapp/pom.xml
    collapsetrue
    urlhttps://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 magnolia-enterprise-pro-webapp inherits from the magnolia-enterprise-standard-webapp, which inherits from the magnolia-community-webapp.

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:

...