Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Getting Started with Maven

Although Maven can be used integrated in your favorite IDE, its basic usage is as a commandline tool. So, go download the latest release and install it. To begin using Maven, you have to download and install it.

Begin here: http://maven.apache.org/download.html

I started with Maven 2.0.4. Download the binary distribution that suits your operating system, e.g. tar.gz (linux), or zip (windows). Unzip the contents to directory that is accessible to your user. My installation is at /home/piratepete/maven-2.0.4 .

However, we can't use Maven just yet. Maven requires two environement variables: M2_HOME, and JAVA_HOME. M2_HOME refers to the directory where you unpacked your Maven, while JAVA_HOME, refers to your JDK directory.

For Unix users: 

and

For Windows users:

and

Environment variables are handy e.g. if you change things a lot. After you install Maven you'll need to set your PATH to the $M2_HOME/bin directory. Although modifying the PATH environmental variable is not required, it is highly recommended so thatyou can use Maven outside its installation directory.

For Unix users: 

PATH=$M2_HOME/bin:$PATH

For Windows users:

Now open a terminal or cmd window. Type the following and you'll see something like:

piratepete@piratepete-laptop:~$ mvn --version
Maven version: 2.0.4

or

  • No labels