[maven] Ubuntu 安装配置 maven

环境

Ubuntu 18
Java 1.8

安装配置

  1. 下载安装
    下载连接上下载 Binary tar.gz archive
  2. 解压
tar xzvf
  1. 环境变量
vim /etc/profile
export MAVEN_HOME=/opt/apache-maven-3.9.0
export PATH=$MAVEN_HOME/bin:$PATH
  1. 检查
source /etc/profile


5. 换仓库和源
打开conf文件夹settings.xml

<localRepository>/opt/repository</localRepository>
<mirror>
    <id>aliyun</id>
    <url>https://maven.aliyun.com/repository/public</url>
    <mirrorOf>${aliyun}</mirrorOf>
  </mirror>
  <mirror>
    <id>netease</id>
    <url>http://mirrors.163.com/maven/repository/maven-public/</url>
    <mirrorOf>${netease}</mirrorOf>
  </mirror>
<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>
  1. 检查
mvn help:system

posted @ 2023-03-03 16:35  伶俐虫虫  阅读(314)  评论(0编辑  收藏  举报