Maven requires JDK support

How to install JDK8

A, download

Maven.apache.org/download.cg…

Upload the file to the /usr/local directory on the server

Second, the decompression

Go to the /usr/local directory

The tar XVF - apache maven - 3.8.1 - bin. Tar. Gz

3. Configure environment variables

vim /etc/profile

Append at the bottom

MAVEN_HOME=/usr/local/apache-maven-3.81.
export PATH=${MAVEN_HOME}/bin:${PATH}
Copy the code

Overloading environment variables

source /etc/profile

4. Check whether the installation is successful

mvn -v

5. Maven configuration

Configuring the Remote Mirror warehouse (Ali Mirror)

<mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>
 </mirror> 
Copy the code

JDK version

    <profile>    
     <id>JDK - 1.8 -</id>    
     <activation>    
       <activeByDefault>true</activeByDefault>    
       <jdk>1.8</jdk>    
     </activation>    
       <properties>    
         <maven.compiler.source>1.8</maven.compiler.source>    
         <maven.compiler.target>1.8</maven.compiler.target>    
         <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>    
       </properties>    
    </profile>
Copy the code