5This page describes how to install and setup Maven to get access to the Magnolia Maven repository (https://nexus.magnolia-cms.com/) for users with Community Edition (CE) or Enterprise Edition (EE) license.
Make sure you have installed a Java JDK SE (Java Development Kit Standard Edition) version 1.6 or higher. Currently we recommend 1.7.
Install Maven version 3
Download Maven from Apache Maven Project. Download a package you can work with (.zip or .tar.gz) on your OS.
For OS specific installations see Apache Maven Project. If you follow the OS specific instructions, you will set some environment variables.
Verify the Maven version
When you have finished the installation, verify that Maven is set correctly:
- Open a terminal or a shell.
- Issue the command: mvn -version
You should see something like that:
The .m2 directory
As soon as you start using Maven, Maven will use a local repository. This repository as well as settings and properties files are located within the .m2 directory.
The location of the .m2 directory depends on your OS.
Maven will create the
.m2 directory the first time when it is required.
Set up for CE users
If you are using an EE license, skip this section
When using a CE license you only have access to public resources.
All you have to do is to add the public nexus repository either to the pom file of your projects or to your maven settings.xml.
Init maven for CE users
If you have no
settings.xml, you can init Maven with a Maven command which will create the settings.xml including the settings for nexus.
Execute the following:
Maven will ask you:
- For a username and a password; enter anonymous for both.
- To select a Template: choose magnolia-community-public
The settings.xml is saved within your ~/.m2/ directory.
Setup for EE users
In this section we will explain what must be done to setup your Maven settings which allows you to access restricted data. As an EE user you have received credentials - a username and a password.
First you should verify your credentials. As a second step we recommend to prepare Maven to let it use encrypted credentials, finally you are going to run a Maven command to setup the settings.xml (even if you already have one).
Verify username and password
Magnolia has provided you a username and password which gives you access to several resources, theses credentials also will be used by Maven to download resources which are restricted. Verify now your credentials:
Go to https://nexus.magnolia-cms.com/ with the browser of your choice and try to login.
If your credentials are correct, the login works fine and your username will be displayed on the top right corner of the Magnolia nexus page.
Enable password encryption
Per default credentials for a repository are stored in the settings.xml file in plain text. However, Maven supports password encryption. We highly recommend that you encrypt your password.
Use a shell and execute the following command:
Enter "master Maven password" when prompted for.
Maven creates the file
~/.m2/settings-security.xml. These security settings will be used to encrypt your credentials for the repositories.
Note that the so called "master Maven password" has nothing to do with the nexus credentials, just choose one. The master Maven password will be used to encrypt credentials for specific repositories like Magnolia nexus.
The first time when trying to access data from a repository Maven will ask you for your credentials for this repository (in our case for Magnolia Nexus). Maven creates encrypted token for both username and password and adds these tokens into the settings.xml (instead of plain text credentials).
Init maven for EE users
Now we setup maven with the settings for Magnolia nexus. During this process the
~/.m2/settings.xml will be created.
If you already have a settings.xml, Maven creates a backup of the old version. You might have to manually merge the newly created settings.xml containing Magnolia specific settings with your existing custom settings. If you need help, ask at the forum.
Switch to your shell and add the following Maven command:
Maven will ask you to prompt your Nexus credentials. Enter username and password which was provided to you by Magnolia.
Now you are ready to download resources from Nexus which are restricted.
Test the Maven Nexus settings
A simple way to test your settings: Try to build a project with Maven which is dependent on a Magnolia Enterprise module. You should be able to build it with the
If you do not have such a project, clone the
documentation-check-maven-settings from our git repository and build it with Maven.
Open a terminal, change to a temporary directory and clone the
documentation-check-maven-settings module from magnolia git:
Now change into the cloned module and build the project with the -U option:
Maven will print out all the downloaded artifacts. At the end it should display the "BUILD SUCCESS" message:
You can login on the wiki, but your credentials seem to be rejected by the Nexus template download
Some characters such as the euro "€" symbol in passwords cause issues. Try changing your password and see if that helps. If this doesn't help, ask for help on the Magnolia forum.
3rd party repositories
Depending on the network infrastructure you work with, you probably have to add further repositories to your settings.xml.
If you failed to build the project above because Maven was not able to download a Vaadin artifact, add the following snippet to your settings.xml.
You have your own Maven repository
If you have your own Maven repository, these are the repositories you can mirror.
- https://nexus.magnolia-cms.com/content/repositories/magnolia.public.releases/ 1
- https://nexus.magnolia-cms.com/content/repositories/magnolia.public.snapshots/ 1
- https://nexus.magnolia-cms.com/content/repositories/magnolia.forge.releases/ 1
- https://nexus.magnolia-cms.com/content/repositories/magnolia.forge.snapshots/ 1
- https://nexus.magnolia-cms.com/content/repositories/magnolia.enterprise.releases/ 2
- https://nexus.magnolia-cms.com/content/repositories/magnolia.enterprise.snapshots/ 2
- https://nexus.magnolia-cms.com/content/repositories/thirdparty.customized/ 3
- https://nexus.magnolia-cms.com/content/repositories/thirdparty.licensed/ 4
- These repositories will eventually be synched to the Maven Central Repository so watch for changes to this page.
- You need a Magnolia account to access these repositories. Please get a "robots" account with us.
- This will also possibly, eventually, be synched to the Maven Central Repository - contains a few third party artifact we customized and released ourselves (for example a bugfix release of OpenWFE) - we're working on making this obsolete, i.e use dependencies which are available on the Maven Central Repository.
- A few artifacts Magnolia uses which are not available on the Maven Central Repository.