Apache Maven is used to build Magnolia. See Maven Getting Started Guide to learn about Maven. Introduction to POM is also useful since pom.xmls are used for Magnolia. Documentation on Maven can also be found in Eclipse by clicking Help > Help Contents and opening Maven: The Definitive Guide.

Download Maven 2.2.1. Other versions may not work.


This procedure consist of three parts: installing Maven (this page), adding environment variables and initializing the environment.

(warning) You will need a Nexus username and password at the end of this procedure.

To download Maven:

  1. Go to Maven downloads.
  2. Click a Maven 2.2.1 link for a binary download.
  3. Click a link for a download mirror and save file.

To install Maven:

  1. Unzip downloaded Maven archive (in Windows right-click and click Extract All) to the directory in which you wish to install Maven. These instructions assume you chose C:\Program Files\Apache Software Foundation and installed Maven version 2.2.1. The subdirectory apache-maven-2.2.1 is created from the archive.
  2. Add environment variables
  3. Open Command Prompt.
  4. Verify correct installation.
    mvn --version
  5. Create .m2 directory in user home directory. For Windows Vista, the user home directory is C:\Users\username. Windows won't accept .m2 as a folder name due to starting with a period. Type mkdir .m2 in Command Prompt to create the directory.
  6. Initialize Maven environment.

Next: Deploying a WAR on Tomcat


If mvn --version is not a recognized command:

  1. Enter cd %java_home% and verify directory is changed correctly.
    If directory is not correct, check JAVA_HOME setting in Environment Variables.
  2. Enter cd %m2% and verify directory is changed correctly.
    If directory is not correct, check M2 and M2_HOME settings in Environment Variables
  3. Enter path and verify that M2 and JAVA_HOME directories are in the path.
    If M2 and JAVA_HOME directories are not in path, check Path setting in Environment Variables.

Add MAVEN_OPTS environment variable in the user variables to specify JVM properties, e.g. the value -Xms256m -Xmx512m. This environment variable can be used to supply extra options to Maven.

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))
  • No labels