How to install maven environment in linux

System environment
Test system version:RedHat7.5
Maven version:3.8.3
Server creation directory
mkdir -p /usr/local/maven
Switch to directory
cd /usr/local/maven
Copy files to the server
scp /c/Users/cmdhelp/Desktop/apache-maven-3.8.3-bin.tar.gz root@
Unzip maven
tar -zxvf apache-maven-3.8.3-bin.tar.gz
Enter the maven directory
cd apache-maven-3.8.3
Create a warehouse catalog
mkdir repository
Enter the configuration directory
cd conf
Edit configuration file
vi settings.xml
Add under the localRepository comment
Add environment variables
vi /etc/profile
Environment variable content
export MAVEN_HOME=/usr/local/maven/apache-maven-3.8.3
Environment takes effect
source /etc/profile
View maven version
mvn -v
Was this helpful?

I hope to help every developer quickly find the commands they need. Of course, you can also add your own commonly used commands for easy searching.