Page tree
Skip to end of metadata
Go to start of metadata

A bundle is a package consisting of a Magnolia webapp and a selection of modules. Each bundle has a particular purpose such as demonstration or production use. In this tutorial you create your own bundle. Select only the modules the project needs, not more. A small purpose-built bundle is easy to understand and fast to build and deploy. Maven handles the dependencies between modules.  

Bundles provided by Magnolia

Best practice

The CE and EE bundles are not the best basis for your own bundle. Many developers start a Magnolia project using the CE bundle as a basis but often it contains more modules than you actually need. A small, targeted bundle makes building and deploying faster. When you don't need a module, leave it out. Streamline your Magnolia project to meet the specific demands of the project. You should build your own bundle based on magnolia-empty-webapp which brings the Magnolia webapp and some basic modules.

Magnolia provides a number of ready-made bundles. For more information please read bundles and webapps.

 Click here to expand to see the list of preconfigured Magnolia bundles

Magnolia provides the following webapps. Some of them include Tomcat.

Artifact

   Download  

   With STK based demo  

   With travel demo  

   With EE Standard modules  

   With EE Pro modules  

   With Apache Tomcat  

Usage / purposeModules summary 1
Community edition

magnolia-empty-webapp

     This is the most basic Magnolia webapp. Use this as a base for custom tailored webapp.Core modules from main and ui, Activation, cache (core and ehcache), Pages, Resources, Security and Scheduler.

magnolia-community-webapp

     Complete Magnolia community edition webapp; no demo project.Same as magnolia-empty-webapp plus:
Cache tools,  Cache Browser, Categorization, Commenting, Contacts, DAM , Form, Google sitemap, Groovy, Mail, Messages, MTE , REST and Site.

magnolia-community-demo-webapp

 (tick)   Same as magnolia-community-webapp plus the travel demo Travel demo community edition 2

magnolia-bundled-webapp

 

 

(tick)   (warning) Deprecated - use magnolia-community-demo-webapp instead!
magnolia-community-demo-bundle
 (tick)  
Tomcat-bundle including magnolia-bundled-webapp and travel demoTravel demo community edition 2

magnolia-tomcat-bundle

  (tick)  
(warning) Deprecated - use magnolia-community-demo-bundle instead!

Enterprise standard edition

magnolia‑enterprise‑standard‑webapp

  (tick)  Same as magnolia-community-webapp plus Enterprise Standard modules; no demo

Backup, Content Dependencies, Content Translation Support, Diff, Google Analytics, Marketing Tags, Personalization, Soft Locking, Transactional Activation and Workflow.

magnolia‑enterprise‑standard‑demo‑webapp

 (tick)(tick)  Same as magnolia‑enterprise‑standard‑webapp plus the travel demoTravel demo Enterprise Standard edition 3
Enterprise pro edition  

magnolia-enterprise-pro-webapp

  (tick)(tick) magnolia-enterprise-standard-webapp plus Enterprise Pro module(s); no demo

Backup, Content Dependencies , Content Translation Support , Diff , Google Analytics, Marketing Tags , Personalization , Soft Locking , Transactional Activation  and Workflow.

Multisite

magnolia-enterprise-pro-stk-webapp

(tick) (tick)(tick) Same as magnolia-enterprise-pro-webapp plus the STK demoAll modules from magnolia-enterprise-pro-webapp plus STK based demo 5

magnolia-enterprise-pro-stk-bundle

(tick) (tick)(tick)
Tomcat bundle including magnolia-enterprise-pro-stk-webapp with STK demoAll modules from magnolia-enterprise-pro-webapp plus STK based demo 5
magnolia-enterprise-pro-demo-webapp
 (tick)(tick)(tick) magnolia-enterprise-pro-webapp plus the travel demoTravel demo enterprise pro edition 4

magnolia-enterprise-webapp

  (tick)(tick)(tick) (warning) Deprecated - use magnolia-enterprise-pro-demo-webapp instead!
magnolia-enterprise-pro-demo-bundle
 (tick)(tick)(tick)
Tomcat bundle with magnolia-enterprise-webapp including travel demoTravel demo Enterprise Pro edition 4
magnolia-enterprise-installer

 (tick)(tick)(tick)
Installer for magnolia-enterprise-pro-demo-bundle

magnolia-enterprise-bundle

  (tick)(tick)(tick)
(warning) Deprecated - use magnolia-enterprise-pro-demo-bundle instead!

magnolia-enterprise-weblogic-webapp

 (tick)(tick) 6(tick) Webapp based on magnolia-enterprise-webapp including travel demo; tuned for Weblogic without workflow 6Travel demo Enterprise Pro edition 4

magnolia-enterprise-websphere-webapp

 (tick)(tick) 6(tick) Webapp based on magnolia-enterprise-webapp including travel demo; tuned for Websphere without workflow 6Travel demo Enterprise Pro edition 4

(1) The module summary does not list exactly all modules but provides a good summary. To get the complete list of the modules please have careful look at the corresponding pom file of the bundle.
(2) Travel demo community edition contains the following modules: magnolia-travel-demo, magnolia-travel-tours.
(3) Travel demo enterprise standard edition contains the following modules: magnolia-travel-demo, magnolia-travel-tours, magnolia-travel-demo-personalization, magnolia-travel-demo-marketing-tags.
(4) Travel demo enterprise pro edition contains the following modules: magnolia-travel-demo, magnolia-travel-tours, magnolia-travel-demo-personalization, magnolia-travel-demo-marketing-tags, magnolia-travel-demo-multisite.
(5) Complete STK bundle with the modules magnolia-module-standard-templating-kit, magnolia-theme-pop and magnolia-demo-project.
(6) Both magnolia-enterprise-weblogic-webapp and magnolia-enterprise-websphere-webapp contain all enterprise standard and pro modules but not those for workflow.

 

Tools

In this tutorial we use:

  • Maven: You should be familiar with the Maven dependency mechanism. The same concept applies to other dependency management and build tools such as Ant+Ivy or Gradle. See Maven setup if you are new to Maven or want to install it in order get access to Magnolia resources from Magnolia Nexus.
  • IDE: The examples and screenshots are from IntelliJ IDEA but any Java IDE such as Eclipse or Netbeans works. If you work with a different tool and would like to contribute steps, leave a comment.
  • Terminal or command line: Some commands in this tutorial are Mac OS X specific. Replace them with equivalent commands on your operating system.

Create an empty project

Maven archetypes are like templates for projects. An archetype makes it easy to generate a project quickly. By using an archetype you can be sure that your project has the correct structure. An archetype readily defines typical dependencies such as a dependency to a Magnolia webapp. The Magnolia archetype catalog provides examples for various types of modules.

  1. Open a terminal and go to a directory where you keep your Magnolia projects.

    cd ~/development/magnolia
  1. fake
  2. Generate a new project from a Maven archetype:

    mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeCatalog=https://nexus.magnolia-cms.com/content/groups/public/ 

  1. fake
  2. fake
  3. Choose the magnolia-project-archetype from the options Maven presents.
  4. Provide the project information. Press ENTER to accept the default.
    • Version: Choose the latest version provided.
    • Group ID: example.com or a group ID that reflects your company.
    • Artifact ID: example-project or an artifact ID that reflects your project.
    • Version: 1.0-SNAPSHOT
    • Package: example.com. Maven proposes a package name based on the group ID. You can change it later in configuration.
    • Magnolia version: Find the latest Magnolia version in Releases, for example 5.4.
    • Project name: example.com. Maven proposes a package name based on the group ID. You can change it later in configuration.
  1. fake
  2. fake
  3. fake
  4. fake
  5. Verify your input and accept with Y:

    Confirm properties configuration:
    groupId: com.example
    artifactId: example-project
    version: 1.0-SNAPSHOT
    package: com.example
    magnolia-version: 5.4
    project-name: example-project

Maven creates an empty project structure in the current directory.

Project structure:

  • example-project: Parent project.
    • example-project-webapp: Your custom bundle as a child Maven project. Here you find a typical Magnolia project folder structure.
      • pom.xml: Webapp project POM.
      • src: Java source code and project configuration
    • pom.xml: Parent POM.

Build the project

Go to the project folder that Maven created:

cd example-project

Build the project:

mvn clean install

Run the project

Open the project in your IDE. These instructions are for IntelliJ IDEA. Adapt for other IDEs.

  1. In IDEA, go to File > Import project > Browse to the parent project pom.xml.
  2. Go to Run > Edit Configurations > + > Tomcat Server > Local.
  3. Go to the Deployment tab and add an artifact example-project-webapp:war exploded.
  4. Set Application Context to root (/). You can deploy the application to a different context if you like.
  5. Start the project.

The Tomcat application server starts and deploys the Magnolia project. If your IDE does not open a Web browser automatically, go to http://localhost:8080/ .

Install Magnolia and log in

Start Magnolia installation.

Note: The screenshot above is outdated showing installation tasks when using Magnolia 5.3.6. We recommend always using the latest stable Magnolia version when creating a new custom bundle.

Log in:

  • Username: superuser
  • Password: superuser

You are now running a basic Magnolia project with an empty webapp.

Add modules

If the magnolia-empty-webapp runs without errors, the project is ready to add modules according to your requirements. In this example we add the REST modules.

Look at the parent project pom.xml file in example-project/pom.xml. It uses Maven's dependency management mechanism to import dependencies from the ce-bundle (lines 49-55). This means that when you add modules to your example-project-webapp you don't have to specify their versions. Version numbers are inherited from the dependency-management section of the ce-bundle. You only need to specify the version in example-project/example-project-webapp/pom.xml if you want to override the versions defined in the dependency management of the ce-bundle.

To add the REST modules to your project, add the following code in the dependencies section of the webapp pom in example-project/example-project-webapp/pom.xml:

example-project/example-project-webapp/pom.xml
<dependency>
  <groupId>info.magnolia.rest</groupId>
  <artifactId>magnolia-rest-integration</artifactId>
</dependency>
<dependency>
  <groupId>info.magnolia.rest</groupId>
  <artifactId>magnolia-rest-services</artifactId>
</dependency>
<dependency>
  <groupId>info.magnolia.rest</groupId>
  <artifactId>magnolia-rest-tools</artifactId>
</dependency>

(info) IntelliJ IDEA displays a notification when you modify a POM file. It prompts you to “Import Changes” or “Enable Auto-Import”. Enabling auto-import works quite well but can be resource intensive if you modify POM files heavily. In this example you can enable auto-import. If you choose not to, remember to click “Import Changes” at least once before starting up the server.

Restart your server for the new modules to be picked up. Magnolia asks you to install the REST modules. After installation you can find a new app in the Dev group and you can start the REST Tools app.

 

Conclusion

In this tutorial you learned how to create a Magnolia project from a Maven archetype, built the project with Maven, and added custom modules. The project does not do much yet but you reached important goals already:

  • You built your own project with Magnolia. You did not need to manually “drop a jar” in the Web application or modify a configuration file in the deployed webapp.
  • The build is reproducible. You can check your files into a source control system. Based on the files your team mates or a continuous integration server can reproduce the build any time. They can also release your project.

Credits: