ubantu安装maven

下载地址

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

或直接命令行下载

wget https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz

 

安装

sudo tar -zxvf apache-maven-3.6.3-bin.tar.gz -C /opt/app

sudo vim /etc/profile

## maven配置

export M2_HOME=/opt/app/apache-maven-3.6.3

export PATH=${M2_HOME}/bin:$PATH

source /etc/profile

 

mvn -v

 

 

sudo tar -zxvf apache-maven-3.6.3-bin.tar.gz -C /opt/eclipse_java/app

export M2_HOME=/opt/eclipse_java/app/apache-maven-3.6.3

export PATH=${M2_HOME}/bin:$PATH

 

精简配置-阿里镜像

settings_springboot_simple.xml

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <localRepository>/opt/wks/jar/springboot</localRepository>

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

  <profiles>
    <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>
  </profiles>
</settings>

 

posted @ 2020-03-07 11:18  方诚  阅读(204)  评论(0编辑  收藏  举报