Pages

Wednesday, August 8, 2012

An introduction to maven : How to setup maven manually

Maven is a built tool like ant. It is mainly used in building a program and project management. First the question is why do we need maven? below are some of the reasons to why we need maven.

  • It is very much likely that a program use jar libraries. We need to make sure these jars are available at the compile time, when bundling the program. Maven helps us in this regard.
  • Another problem is dependencies. A jar in the program may require another jar. May be the jars needed may need to have specific versions. This can be handled using maven.
  • To set a project structure, we can use maven.
  • To build, publish and to deploy.
Second question is how to set up maven? This is described below. This is very easy.
  • download maven from http://maven.apache.org/download.html
  • Then extract it to some location
  • open a terminal and type:           export MQ_HOME=/home/madhumal/apache-maven-3.0.4
  • Then type:                    export PATH="$PATH":/home/madhumal/apache-maven-3.0.4/bin
  • Now type :                    mvn --version
  • You will get the maven version and that is it. Not that the MQ_HOME is the path where you extracted maven binaries.
Alternatively the NetBeans IDE has inbuilt support for maven as well.

I will post more about maven in later posts.

No comments:

Post a Comment