2
我想在我的pom.xml中添加一個依賴項來檢出github庫中的libray。添加maven依賴項問題
我的POM文件是:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.nvtien.test</groupId>
<artifactId>tester</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.levonk</groupId>
<artifactId>codequality</artifactId>
<version>1.0.4</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>cemerick-snapshots</id>
<url>https://raw.github.com/cemerick/cemerick-mvn-repo/snapshots</url>
</repository>
</repositories></project>
這裏是GitHub的庫:
https://github.com/levonk/pub-maven-repo
我的地方〜2/settings.xml中
<servers>
<server>
<id>github</id>
<username>XXXX</username>
<password>XXXX</password>
</server></servers>
,我發現一個錯誤通過maven日誌:
[錯誤]無法執行項目測試人員的目標:無法解析項目com.nvtien.test的相關性:tester:jar:0.0.1-SNAPSHOT: github.com/cemerick/cemerick-mvn-repo/snapshots被緩存在本地存儲庫中,分辨率將不會被重新嘗試,直到更新 →[Help 1]
我的問題是:出了什麼問題?爲什麼maven不能下載codequality-1.0.4.jar?
你本地settings.xml文件? –