Monday, September 19, 2016

Installing mvnw on Ubuntu

Typically when working with jhipster applications there is are mvnw commands that needs to be executed.

The mvnw tool which is wrapper on top of maven needs to be installed by following the example set at https://github.com/vdemeester/mvnw .

First need to checkout the tool :
git clone git://github.com/vdemeester/mvnw.git ~/.mvnw

Then you need to add the following environment variable within .bashrc:


nano ~/.bashrc

Command:
export PATH="$HOME/.mvnw/bin:$PATH"

then enable it :
. ~/.bashrc


Install Maven 3.3.9 on ubuntu

The following commands needs to be adapted based on the version of Maven you want to install , the latest version can be found on Maven download page .

This article assumes that you are installing on Ubuntu the version 3.3.9 of maven ( currently latest version as am writing entry ):

wget http://apache.mirrors.lucidnetworks.net/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

sudo mkdir -p /usr/local/apache-maven

sudo mv apache-maven-3.3.9-bin.tar.gz /usr/local/apache-maven

cd /usr/local/apache-maven

sudo tar -xzvf apache-maven-3.3.9-bin.tar.gz

Once this is done add to you environment variables by editing .bashrc:

nano ~/.bashrc

export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.9
export M2=$M2_HOME/bin
export MAVEN_OPTS="-Xms256m -Xmx512m"
export PATH=$M2:$PATH

then apply it by executing :
. ~/.bashrc