Wednesday, July 24, 2013

Building maven 3 in Linux

I thought it may be useful to have an explanation on how to build maven 3. My current setup is really simple:

* Linux Debian Squeeze
* Java 6 update 26
* ant 1.9.2 (1.8 does not work)

Step by step process using ant:
  • Download sources
  • Quickly read through:
  • Set the M2_HOME environment variable to the location that should contain Maven. This directory must be named after the Maven version you want to build and install, for example /usr/local/maven-3.1
    • export M2_HOME=/usr/local/maven-3.1
    • PATH=$M2_HOME/bin:$PATH
  • Execute ant (becuase I chose to install in /usr/local/... I had to run ant as root)
  • Execute as any user:
    • mvn -version. and the newly installed version will show up
Have fun!