Maven
Apache Maven is used to build Magnolia CMS. 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.
Installing
This procedure consist of three parts: installing Maven (this page), adding environment variables and initializing the environment.
You will need a Nexus username and password at the end of this procedure.
To download Maven:
- Go to Maven downloads.
- Click a Maven 2.2.1 link for a binary download. Magnolia recommends Maven 2.2.1. Other versions may not work.

- Click a link for a download mirror and save file.

- 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 Foundationand installed Maven version 2.2.1. The subdirectoryapache-maven-2.2.1is created from the archive. - Add environment variables
- Open Command Prompt.
- Verify correct installation.
mvn --version

- Create
.m2directory in user home directory. For Windows Vista, the user home directory isC:\Users\username. Windows won't accept.m2as a folder name due to starting with a period. Typemkdir .m2in Command Prompt to create the directory. - Initialize Maven environment.
Troubleshooting
Ifmvn --version is not a recognized command:
- Enter
cd %java_home%and verify directory is changed correctly.
If directory is not correct, checkJAVA_HOMEsetting in Environment Variables. - Enter
cd %m2%and verify directory is changed correctly.
If directory is not correct, checkM2andM2_HOMEsettings in Environment Variables - Enter
pathand verify thatM2andJAVA_HOMEdirectories are in the path.
IfM2andJAVA_HOMEdirectories are not in path, checkPathsetting in Environment Variables.
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.