Skip to end of metadata
Go to start of metadata

Your Rating: Results: PatheticBadOKGoodOutstanding! 67 rates

This page describes how to set up Apache Maven. Follow the official documentation if you are a Community Edition developer, an Enterprise Edition developer or have a project on the Magnolia Forge. Follow the instructions below if you work for Magnolia International. In either case, encrypt your password.

Maven is used to build Magnolia CMS. For more information see Maven website and the freely available Sonatype books.

If you already have a settings.xml file

If you do development with Maven, you probably already have a settings.xml file. The process below overrides your existing ~/.m2/settings.xml. (It creates a backup so no panic.) You might have to manually merge Magnolia specific settings with your existing settings. If you need help, ask at the forum.

Adding <repository> references in the pom files is not an option at the moment as it will prevent our repositories from synchronizing with the Maven Central Repository.

Password encryption

Your Nexus username and password are stored in the settings.xml file in plain text. Maven supports password encryption, however. If you prefer to encrypt your password, do it first. Use the following scripts in a Unix terminal.

Setting up a master password

Create a ~/.m2/settings-security.xml file which contains your encrypted master password. Maven uses this file for further password encryption.

If you can't use the command above (on Windows, typically), just follow the How to create a master password instructions in the Maven documentation.

Setting up your Magnolia Nexus password

Create a ~/.m2/settings-defaults.properties file which will be used to interpolate the Maven settings downloaded from our Nexus instance.

If you can't use the commands above, take the following steps:

  1. Encrypt your password with Maven. This will output an encrypted version of your password in the terminal.

  2. Create a ~/.m2/settings-defaults.propertiesfile with the following contents:

    (warning) You need to have both the Master Maven password (in /.m2/settings-security.xml) and the magnolia.nexus.password (in /.m2/settings-defaults.properties) before applying the settings below. If you change either, you'll have to re-execute the follow-up commands (i.e change the master: re-generate the maven.nexus password AND the settings.xml, if only the latter, you'll also have to regenerate your settings.xml)

Community Edition, Enterprise Edition and Forge users

If you are a Community Edition user, an Enterprise Edition user or host your project on the Magnolia Forge, follow the Maven initialization instructions in official documentation.

Magnolia International developers

If you work at Magnolia International, you'll find instructions in the intranet. (wink) (Maven tips)

You have your own Maven repository

If you have your own Maven repository, these are the repositories you can mirror.

Remarks:

  1. These repositories will eventually be synched to the Maven Central Repository so watch for changes to this page.
  2. You need a Magnolia account to access these repositories:
  3. 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.
  4. A few artifacts Magnolia uses which are not available on the Maven Central Repository.

Syncing with the Maven Central Repository

We are currently working on getting our public repositories synched to the Maven Central Repository. This would mean, amongst other things, that unless you need snapshots or enterprise-only artifacts, no settings.xml modifications would be necessary.

There are a few third party dependencies we had to fix or release ourselves because they were not present in the Maven Central Repository when we started using them. For most, we should be able to either upgrade to a newer version present on the Maven Central Repository, or have them uploaded. This might take a little while. When that's resolved, we will hopefully be able to completely synchronize our public repositories with the Maven Central Repository!

Troubleshooting

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 not, ask Greg. He will verify your permissions.

You can login on the Nexus web interface, your template was generated successfully, but somehow the builds fail with permissions issues

It seems some passwords just don't get encrypted correctly (at least with Maven 2.2.1?). Try replacing the encrypted password in your ~/.m2/settings.xml file by its plain text counterpart. If that doesn't work, see above.

 

Labels
  • None
  1. Aug 11, 2010

    In maven-settings-template-enterprise.xml please change the following:

    <server>

    <id>magnolia.nexus.enterprise</id>

    </server>

    <repository>

    <id>magnolia.nexus.enterprise</id>

    <url>http://nexus.magnolia-cms.com/content/repositories/magnolia.enterprise.releases</url>

    1. Aug 11, 2010

      Server id is fixed; repo url should still point to the group - well, that's up to you, but using the group, you get releases, snapshots and 3rd party artifacts (those which are not available on central). As mentioned above, if you have your own Maven proxy, then you should proxy our repositories instead, indeed.

  2. Aug 13, 2010

    There was a typo in the previous version of the enterprise settings template, please update !

    1. May 27, 2013

      If you use your own repository manager and proxy all your request through it, I'd suggest to do that, yeah. If on the other hand you're specifying repos in your local settings.xml, just use http://nexus.magnolia-cms.com/content/groups/public. Using the template as per http://documentation.magnolia-cms.com/developing/dev-environment/maven/maven-init.html could help if you don't have a custom settings.xml. OTOH, the archetype should have produced a module that has the appropriate <repository> item(s) in the generated pom.xml.