Eclipse Maven倉庫阿里雲映象配置
阿新 • • 發佈:2018-12-27
小學期暑期實訓,內容是關於 Spring,SpringMVC…
今天第一天進行的是學習 maven 倉庫阿里雲映象配置,特此記錄下,分享給有需要的同學。
這裡先貼一下阿里雲映象網址:http://maven.aliyun.com/nexus/
全球中央伺服器超級慢,這裡大阿里還是很貼心的。
之後是 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">
<pluginGroups>
</pluginGroups>
<proxies>
</proxies>
<servers>
</servers>
<mirrors>
<mirror>
<id >nexus</id>
<name>Tedu Maven</name>
<mirrorOf>*</mirrorOf>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
<!-- <url>http://maven.aliyun.com/content/groups/public</url> -->
</mirror >
</mirrors>
<profiles>
</profiles>
<activeProfiles>
</activeProfiles>
</settings>
注意 url 是阿里雲的映象地址
好了,之後可以開始配置了。
1. 配置匯入 setting.xml 檔案,在偏好設定中,找到 maven,如下圖
2. 之後選擇 Window–>Show View–>Other 選擇 Maven,出現如下檢視
3. 這裡舉個例子,比如你要新增 commons-codec 的 jar 包,可以在阿里雲映象網頁上搜索,找到 maven 座標,如下
將右下角的的 dependency 標籤貼上至 pom.xml 檔案中如下
至此,全部配置成功!!!!