nexus3 配置
Repository > Repositories
- 添加一个新的存储库
- 选择 maven2 (proxy)
- 输入以下项(其他使用默认值)
- Name
maven-central
- Remote store
https://maven.aliyun.com/repository/public
- Name
Binary tar.gz archive
。
添加环境变量,通常在 /etc/profile
或 ~/.profile
# 目录路径按实际修改
export MAVEN_HOME=/home/maven/apache-maven-3.3.9
export PATH=$PATH:$MAVEN_HOME/bin
# 注销后不用执行
source ~/.profile
mvn -v
修改安装目录下的 conf/settings.xml
文件,在 <mirrors>
标签内添加如下内容:
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>