Download Maven 3.3

Posted on by

In this tutorial, we will show you how to install Apache Maven on Ubuntu. Maven 3.5.2; Ubuntu 18.04. How to install Apache Maven 3 3 9. Required: Jdk1.8.0 Windows 10 Command: mvn -version mvn -help mvn clean build install. Install the Maven Repository. Local File System Repository Installation; 3.3.2. Apache httpd Repository Installation; 3.3.3. Maven Repository Manager Installation. This example will cover the steps to download the JBoss Data Grid Maven Repository for use with Apache httpd. This option is good for multi-user and cross-team.

install-apache-maven-3.3.9.sh
#!/bin/sh
wget http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar xzf apache-maven-3.3.9-bin.tar.gz
mkdir /usr/local/maven
mv apache-maven-3.3.9/ /usr/local/maven/
alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
alternatives --config mvn

commented Jul 30, 2017

Awesome Script! Thanks

commented Sep 30, 2017
edited

Perfect, Except that for the alternative command I needed to uninstall original maven package using yum remove maven

commented Dec 14, 2017
edited

@nadalizadeh you must have had a previous installation of maven. Script worked fine for me as it's written. Although it wouldn't harm the gist having a yum remove -y maven in it.

Device doctor free. Device Doctor is a free Windows application that scans your computer hardware and checks to see if there are new driver updates available for your devices. It also locates drivers for 'unidentified devices' in the Windows Device Manager.

As a side note I don't think alternatives --config mvn is necessary if this is the only mvn install, also the script above sets the priority to 1 in the install line. Reason I mention it is because I want this in a Dockerfile and I can't have alternatives --config mvn asking for user input.
You could instead say alternatives --auto mvnvia this man page.

commented Jan 26, 2018

Awesome! Thanks!

commented Sep 21, 2018

The line 7 seems in correct. You have already moved apache-maven-3.3.9 to /usr/local/maven.
Probably should be
alternatives --install /usr/bin/mvn mvn /usr/local/maven/bin/mvn 1

Download Maven 3.3.3

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment