Categories
Build Script Maven

How to Install Maven

Maven is a lightweight distributed tool. Hence it does not have any specific hardware requirement.

Following are steps to install Maven on Windows platform.

  1. It is developed in JAVA language. Hence it will need Java Virtual machine installed as software requirement. To check that JVM is installed on your machine, run following command. It should print the JDK version on your machine. If it does not print, follow link to install JVM
C:\Users\guest>java -version
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)

2. Download Maven distribution package from here

3. Unzip the downloaded file into “c:/Program Files/ASF” directory.

4. Set environment variable M2_HOME that point to unzipped directory in step3, say “C:\Program Files\ASF\apache-maven-3.3.3\bin”

5. Modify environment variable named “PATH” to append %M2_HOME% as additional value.

6. To check that Maven is installed properly run following command to check maven version

>mvn -version

Categories
Build Script Maven

What is Maven

Every software developer works with Integrated development environments (IDE) like eclipse, netbeans, MS Visual Studio etc. It gives them easy way to write code, that helps. Perhaps while building a project into distribution package, simple IDE may not be of help, since role of IDE is to support individual developer and not the project team.

Hence there comes need of build tool, which would automate several tasks of build process like shutdown servers, compile code, automate tests and generate reports etc. Maven can be viewed as build tool that can help us address these areas with industry standard and industry supported plugins.

However, Maven is more than a build tool. It can do automatic dependency resolution and distribution. It can help manage project source tree across different teams and repositories. It can generate ready to start framework with respect to type of architecture say simple java project that distributes JAR, simple web application that distributes WAR or complex enterprise application that distributes EAR.

Maven is open source tool backed by vast community. It is basically a plugin framework, with extensive set of ready made plugins which we can use or we can write custom one that solves specific problem of life. Hence it is extensible as well.

Several IDEs too support maven. For sake of simplicity and my family of JAVA, we will use eclipse to demonstrate the maven.

Design a site like this with WordPress.com
Get started