1. 點選前往檔案夾

輸入/users/<user name>/.m2
回車
進入到該目錄下,建立settings.xml,預設是沒有該檔案的,eclipse的maven工具安裝時不會建立該檔案
而該檔案上方的repository檔案夾是用來存放通過maven下載下傳的插件的,如下圖
2. 打開eclipse偏好設定
進入maven-user settings,點選user setting的browse按鈕
選擇建立的settings.xml檔案
user setting右邊就會出現open file按鈕
點選open file按鈕就會在eclipse裡面打開settings.xml檔案
3. 在打開的檔案裡輸入
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<!-- mirror | Specifies a repository mirror site to use instead of a given
repository. The repository that | this mirror serves has an ID that matches
the mirrorOf element of this mirror. IDs are used | for inheritance and direct
lookup purposes, and must be unique across the set of mirrors. | -->
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
</mirror>
<mirror>
<id>nexus-aliyun-thirdparty</id>
<mirrorOf>thirdparty</mirrorOf>
<name>Nexus aliyun thirdparty</name>
<url>http://maven.aliyun.com/nexus/content/repositories/thirdparty/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus</id>
<name>local private nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
參考:
https://yq.aliyun.com/articles/6861
把參考文章裡的連結換成aliyun的,開源中國的用不了了
用文章裡的寫法不會報無法讀取settings.xml錯誤
而且經過試驗,下載下傳好插件後,pom.xml也不會報錯,下載下傳速度也比較快