By default OpenSUSE Linux distribution doesn’t have Maven into its repositories because of tons of dependencies which needed for Maven. But in spite of this Maven installation is straightforward in OpenSUSE.
In this tutorial I will show how to install Maven from its official web site.
First of all we need to download Maven from the official web site. There 2 types of archives there:
In this tutorial we will install Maven from the
To download maven we will use
wget. Insure that it’s already installed into the system.
All commands listed bellow will be entered into command prompt (console, terminal) from a regular user(not root).
If nothing was entered after opening terminal the archive will be downloaded into the User’s home folder.
Unzip archive into the
sudo tar -xvzf apache-maven-3.3.9-bin.tar.gz -C /opt
As a result Maven will be extracted into the
sudo mv /opt/apache-maven-3.3.9 /opt/maven
To use maven from the console (terminal) we need to edit the
.bashrcfile and add the following lines:
# ======= maven settings ========= export M2_HOME=/opt/maven/ export M2=$M2_HOME/bin export PATH=$M2:$PATH
Verify that everything works correct:
The output should look like this:
Apache Maven 3.3.9 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T23:58:10+03:00) Maven home: /opt/maven Java version: 1.7.0_51, vendor: Oracle Corporation Java home: /usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.11.10-21-desktop", arch: "amd64", family: "unix"