maven項目中,添加依賴後,出現"Dependency 'xxxx‘ not found"解決過程

轉自:http://www.javashuo.com/article/p-ssydwvpe-q.htmlmaven

idea中修改pom.xml文件,添加各類工程依賴的jar,一直沒有問題,ide

但今天遇到問題,一直提示Dependency 'xxxx‘ not foundurl

但是在maven倉庫是能搜索到的,地址http://mvnrepository.com/idea

jbpm3在maven repository能夠查到,但查找的結果以下所示(注意紅框,它表示這個jar在哪一個倉庫中):spa

 

 

上面明確表示,這個jar包在JBoss Releases的倉庫,而不是在常見的Central中,以下圖所示:.net

 

 

在setting.xml文件中指了默認狀況下,只會從 Central中下載,而鏡像通常只會鏡像central庫,3d

因此就會致使上面的」Dependency 'xxxx‘ not found"情部了。code

(3)、解決方法xml

緣由都知道了,就好辦了。blog

方法1、.在settings.xml中添加對應的倉庫,

方法2、在pom.xml直接添加額外的倉庫。推薦第二種,以下(在</project>以前添加):

<repositories>
<repository>
<id>JBoss repository</id>
<url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
</repository>
</repositories>

上面這段配置只須要點擊

而後從新導入一下,理論上應該B把url替換爲這個這裏的url就解決了。

第一種方法就是在settings.xml中添加以下鏡像:

<mirror>  

      <id>jboss</id>  

<name>jboss</name>  

 <url>https://repository.jboss.org/nexus/content/repositories/releases/</url>  

 <mirrorOf>JBoss Releases</mirrorOf>        

</mirror>
相關文章
相關標籤/搜索