问题:
解决:
- 执行 mvn -v 找到 maven home path
- cp **maven home dir**/conf/settings.xml 到 ~/.m2/settings.xml
- 修改增加
|
<mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> |
http://maven.apache.org/settings.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
<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 https://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository/> <interactiveMode/> <offline/> <pluginGroups/> <servers/> <mirrors> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors> <proxies/> <profiles/> <activeProfiles/> </settings> |
参考:
https://developer.aliyun.com/mvn/guide