We’ll show you how to install Maven on CenOS 7. Apache Maven is free and open source java based software for project management and comprehension tool. Maven allows users to easily store documents, generate reports and documentation from a central piece of information. Installing Maven on CentOS 7 is fairly easy task, just carefully follow the steps bellow and you should have Maven installed on your CentOS 7 server in less then 10 minutes.
Listed below are some of the key features of Apache Maven:
– Simple project setup that follows best practices
– Superior dependency management
– Extensible with a lot of plugins written in Java or other scripting languages
– Model based builds
– Release management and distribution publication:
and in the latest Maven 3.5 version, there are lots of bug fixes and important changes such as:
– ANSI colors added to the console
– Fixed several bugs in MVN scripts regarding spaces, quotations and special characters.
– Switch from Eclipse Aether to Maven Artifact Resolver
– and much more
Table of Contents
1. Update the system
To start with the Maven installation, log in to your CentOS 7 server via SSH as user root
and perform a full system update by typing the following command
2. Install Java 8
Since Maven is Java based application we have to install Java on the server. Java version 1.7 or newer is required. We will install Java 8
This command will install Java 8 and all necessary dependencies.
Once installed, run the following command the check the installed version
3. Install and configure Maven on CentOS 7
Apache Maven’s installation is a simple process. Go to their official website and download the arhive of the desired version. In this tutorial we will install Apache Maven version 3.5.3
Unpack the downloaded zip archive
Rename the newly created directory and remove the downloaded archive
We downloaded the precompiled version of Apache Maven, so we have to set the environment variables. Create the following file
Save the file and load the environment variables in the current shell.
With this step Apache Maven should be successfully installed and configured on your CentOS 7 VPS. Run the following command to confirm
and you should get the following output
4. Install Apache Maven from a repository
Apache Maven can be also installed by adding its repository to the server. Please note that this will not install the latest available version Download its official repository
and install Maven with the yum package manager
5. Check installed version
and check the installed version
mvn -v
That’s it, you have successfully installed Maven on CentOS 7. For installing Maven on Ubuntu 16.04 check this tutorial – HOW TO INSTALL MAVEN ON UBUNTU 16.04
If you use one of our CentOS VPS Hosting plans, you don’t have to install Maven on CentOS 7, you can simply ask our expert Linux admins to install Maven on your CentOS 7 server for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post on How to Install Maven on CentOS 7, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.
Why do we need 6 releaseserver
sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
for CentOS7 ?