ubuntu18.04下eclipse修改maven源为阿里源
下载安装Java和Eclipse:https://www.cnblogs.com/zifeiy/p/9030111.html
然后命令行安装Maven(不是必须的):
sudo apt-get install maven -y
然后编辑一个文件/home/zifeiy/.m2/settings.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>
/home/zifeiy/.m2/repository
</localRepository>
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
</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>
<profiles>
</profiles>
</settings>
其中的mirror坐标对应阿里云的Maven镜像源。
然后在Eclipse中:
window --> Preferences --> Maven --> User Settings里面,
配置User Settings为settings.xml文件。
然后Eclipse会更新一下。
好了之后我们可以添加几个没有下在国的坐标看看速度,用于测试的坐标:
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.10-FINAL</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.10-FINAL</version>
</dependency>
发现速度是真的快啊!!!