[maven] Ubuntu 安装配置 maven
环境
Ubuntu 18
Java 1.8
安装配置
- 下载安装
下载连接上下载 Binary tar.gz archive - 解压
tar xzvf
- 环境变量
vim /etc/profile
export MAVEN_HOME=/opt/apache-maven-3.9.0
export PATH=$MAVEN_HOME/bin:$PATH
- 检查
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>
- 检查
mvn help:system