Maven install on centos7

This article demonstrates how to install maven on CentOS7.

1 Ready to work#

1.1 Enter the download section of the official website

http://maven.apache.org/download.cgi

Find the package address of the Binary tar.gz archive in the download list. Take version 3.5.4 as an example, the address is:

http://apache.communilink.net/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz

1.2 Create installation directory###

SSH to the host where maven is installed, such as 192.168.1.101, execute the command:

$ mkdir /usr/local/maven

1.3 Download package

$ wget http://apache.communilink.net/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz

2 Install maven#

2.1 Unzip the package###

$ tar -zxvf  apache-maven-3.5.4-bin.tar.gz -C /usr/local/maven

2.2 Set /etc/profile

$ vi /etc/profile
# Add the following at the end of the file
export MAVEN_HOME=/usr/local/maven/apache-maven-3.5.4export PATH=$PATH:$MAVEN_HOME/bin

2.3 Effective immediately###

$ source /etc/profile

2.4 Check the installation###

$ mvn -v

If the installation is successful, it will display:

Apache Maven 3.5.4(3383c37e1f9e9b3bc3df5050c29c8aff9f295297;2018-02-25T03:49:05+08:00)
Maven home:/usr/local/maven/apache-maven-3.5.4
Java version:1.8.0_161, vendor: OpenJDK
Java home:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161/jre
Default locale: en_US, platform encoding: UTF-8
OS name:"linux", version:"4.15.2-1.el7.elrepo.x86_64", arch:"amd64", family:"unix"

2.5 Set up a local maven repository###

Open the configuration file setting.xml and modify the path of the local maven warehouse:

$ vi $MAVEN_HOME/conf/settings.xml
# Set the path of the local maven repository
< localRepository>/var/lib/maven/repo</localRepository>

Recommended Posts

Maven install on centos7
Install Docker on Centos7
install LNMP on centos7.4
Install Java on Centos 7
Nodejs install on centos7
Install MongoDB on CentOS 7
Install Surelog on CentOS8
Openjdk install on centos7
Install Jenkins on centos7
install RabbitMQ on centos
Install RabbitMQ on CentOS 7
install Docker on centos6.5
install oracle on centos
Install Elasticsearch 6 on centos7
Install RabbitMQ on CentOS7
How to install Apache Maven on CentOS 8
Install ElasticSearch 7.x on CentOS 7
Install docker on Centos system
install EPEL repo on centos
1.5 Install Centos7
Install Zabbix 3.4 based on CentOS 7
install virtualbox on centos server
Install Nginx server on CentOS 7
How to install jdk1.8 on centOS7
How to install MySQL on CentOS 8
Install JDK8 in rpm on CentOS7
How to install R on CentOS 8
How to install FFmpeg on CentOS 8
How to install Virtualbox on CentOS 8
How to install TensorFlow on CentOS 8
How to install TeamViewer on CentOS 8
How to install Gradle on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Jenkins on CentOS 8
How to install Go on CentOS 8
How to install GCC on CentOS 8
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Jenkins on CentOS 8
Install MySQL on Linux CentOS7 (Windows)
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8
How to install Tomcat 9 on CentOS 8
How to install Webmin on CentOS 8
How to install Ruby on CentOS 8
How to install Skype on CentOS 8
How to install htop on CentOS 8
​Install Oracle database on CentOS Linux
How to install Python on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Postgresql on CentOS 8
How to install Wordpress on Centos
How to install htop on CentOS 8
How to install TeamViewer on CentOS 8
How to install MariaDB on CentOS 8
Install WordPress with Caddy on CentOS
How to install MongoDB on CentOS 7
How to install Odoo 13 on CentOS 8
How to install Apache on CentOS 8
How to install OpenCV on CentOS 8