Building Maven

Building Maven is a little different than your typical Java build because Maven uses itself to build itself! Thus, in order to successfully build Maven, a bootstrapping process is required to jumpstart the build. Fortunately, the details of this have been encapsulated in a separate build file called build-bootstrap.xml. This document details the necessary steps to successfully build Maven from source. After completing the process, not only will Maven be built, it will also be installed on your system, which will enable you to build any other Maven-enabled project (i.e. all Turbine projects).

Before you can build Maven, you'll need to make sure you have Ant 1.5 or higher installed on your system. Don't forget to install the optional.jar included with Ant. In addition, you'll also need the JUnit unit testing framework installed. Be sure to install junit.jar in your ANT_HOME/lib directory. Failure to do so will result in build errors.

You also must have the MAVEN_HOME env-var set. The Maven installation is encapsulated in the directory specified by MAVEN_HOME: scripts, Maven's run-time library, plug-ins and the local repository. MAVEN_HOME must not end with a path delimiter - ie. / or \

Note: as the installation of Maven is automatic and part of the build process, make sure you really want to overwrite the files you may have in that location.

For the impatient reader that doesn't want to read the rest of this document, type the following:

All development efforts are now in producing the final 1.0 release. This means the most active (and stable) branch is MAVEN-1_0-BRANCH (in the maven project) and HEAD on maven-plugins.

If you are new to Maven, it is recommended that you read the rest of the document as it explains the build process in a little more detail.

If you are behind a proxy, you must define proxy parameters for building Maven : FAQS.

Bootstrapping Maven

Before you can begin the process, you'll need to download the source from the maven and maven-plugins CVS repository. If you are not familiar with the CVS repositories, please see the documentation.

After setting the value of MAVEN_HOME and pulling down the sources you are now ready to build and install Maven on your system using the bootstrapping process. As mentioned earlier, the bootstrapping process is defined in build-bootstrap.xml, and can be initiated by typing the following:

Thats it! Congratulations! You have now built Maven with Maven and installed Maven on your system!

If you get an OutofMemoryError during bootstrap, try setting an environment variable MAVEN_OPTS to provide more memory, e.g. on Windows

set MAVEN_OPTS=-Xmx512m

Now you're ready to go

  • The Maven build system has been installed in MAVEN_HOME.
  • You can now build any Maven-enabled project with ease! Please see the Using Maven document for instructions on how to build Maven-enabled projects.
  • You can now integrate Maven into your own projects! Please see the Integrate Maven document for instructions on how to do this.

Building the optional plugins

If you're building Maven 1.0-rc2 or later, the maven cvs module will not contain all of the available plugins that are shipped with a release.

The source for the optional plugins can be found in the maven-plugins cvs repository. See the documentation for more information on accessing that repository.

Once you've downloaded the source, you can easily install all the optional plugins in a single command. See the FAQ for more detail on how to install them once downloaded.