阿里云服务器配置 maven
环境变量
阿里云 maven
镜像地址,根据自己需求下载对应版本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| mkdir maven
wget https://mirrors.aliyun.com/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
tar -zxvf apache-maven-3.6.3-bin.tar.gz
cd apache-maven-3.6.3
pwd
vim /etc/profile =====================================================
export MAVEN_HOME=/maven/apache-maven-3.6.3 export PATH=$PATH:$MAVEN_HOME/bin
source /etc/profile
mvn -version
|
修改仓库默认地址,进入 maven
下的 conf
目录,编辑 settings.xml
文件,打开 localRepository
注释的仓库地址,修改自己存放的依赖地址即可
1
| <localRepository>/path/to/local/repo</localRepository>
|
修改 maven
配置文件下的 settings.xml
镜像地址为阿里云的,替换 mirrors
以下配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| <mirror> <id>aliyunId</id> <mirrorOf>central</mirrorOf> <name>aliyun maven</name> <url>https://maven.aliyun.com/repository/central</url> </mirror> <mirror> <id>alimaven</id> <mirrorOf>central</mirrorOf> <name>aliyun maven</name> <url>https://maven.aliyun.com/nexus/content/groups/public/</url> </mirror> <mirror> <id>alimaven</id> <mirrorOf>central</mirrorOf> <name>aliyun maven</name> <url>https://maven.aliyun.com/nexus/content/repositories/central/</url> </mirror> <mirror> <id>alimaven</id> <mirrorOf>central</mirrorOf> <name>aliyun maven</name> <url>https://central.maven.org/maven2</url> </mirror>
|