在eclipse裏使用maven,鏈接nexus私服。eclipse
添加依賴以後,老是報添加的依賴jar文件找不到,可是在nexus的庫裏面能找到這個依賴的jar文件,可是在本地的maven庫裏面找不到,因而我將本地庫裏面這個依賴對應的文件夾刪掉,而後在eclipse裏面執行update dependencies。成功解決問題!maven
右鍵單擊項目->maven->update dependencies。ide
引發的緣由是因爲本地庫從nexus中請求jar文件,若是私服中不存在則取網上下載,若是網速過慢,下載時間超過了maven設置的時間限制就會報該錯誤。this
加入阿里雲資源,速度會快不少
阿里雲
在settings.xml文件中加入url
<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>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
-->
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
</mirrors>spa