Rate This Document
Findability
Accuracy
Completeness
Readability

Installing and Configuring Maven

Before installing the built-in Tomcat of Spring Boot, install and configure Maven to meet the environment requirements for building and running the Spring Boot project.

  1. Download the Maven binary package.
    1
    2
    cd /home
    wget https://dlcdn.apache.org/maven/maven-3/3.8.9/binaries/apache-maven-3.8.9-bin.tar.gz --no-check-certificate
    
  2. Verify the availability of the Maven binary package.
    1
    2
    3
    tar -zxvf apache-maven-3.8.9-bin.tar.gz
    cd /home/apache-maven-3.8.9/bin
    ./mvn --version
    

    If the Maven version is returned, Maven has been successfully downloaded and decompressed.

  3. Configure the Maven environment variables.
    1. Open the /etc/profile file.
      1
      vi /etc/profile
      
    2. Press i to enter the insert mode and add the following content to the file:
      1
      2
      export MAVEN_HOME=/home/apache-maven-3.8.9
      export PATH=$PATH:$MAVEN_HOME/bin
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
    4. Make the configuration take effect.
      1
      source /etc/profile