2015-10-13 55 views
2

我已經下載spring-security-oauth Maven項目從GitHub與樣本tonr2spaklr2Oauth2樣本不工作,因爲依賴性錯誤

在所有jar文件完成下載後,我一直在pom.xml中不斷收到錯誤消息。

<parent> 
    <groupId>org.springframework.security.oauth</groupId> 
    <artifactId>spring-security-oauth-parent</artifactId> 
    <version>2.0.8.BUILD-SNAPSHOT</version> 
    <relativePath>../../..</relativePath> 
</parent> 

它在這個下面的依賴關係中顯示錯誤。

<dependency> 
    <groupId>${project.groupId}</groupId> 
    <artifactId>spring-security-oauth2</artifactId> 
    <version>${project.version}</version> 
</dependency> 

的錯誤是:

Missing artifact org.springframework.security.oauth:spring-security-oauth2:jar:2.0.8.BUILD-SNAPSHOT

運行後命令

mvn install -P bootstrap 

我得到了一個錯誤:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2. 
12.4:test (default-test) on project spring-security-oauth2: There are test failu 
res. 
[ERROR] 
[ERROR] Please refer to C:\Users\a.bazaldua.cerda\Desktop\Oauth\spring-security- 
oauth-master\spring-security-oauth2\target\surefire-reports for the individual t 
est results. 
[ERROR] -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit 
ch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please rea 
d the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc 
eption 
+0

你跑了什麼Maven命令? – Tunaki

+0

我在eclipse中的項目,所以首先我清理項目,後來我做一個maven升級...之後,我做maven乾淨和maven安裝....但錯誤仍然存​​在 – arnoldssss

回答

0

要構建spring-security-oauth項目,首先需要運行以下ng命令:

mvn clean install -P bootstrap -DskipTests=true 

您可以直接在命令行上運行它(這是簡單的解決方案)。

如果您想在Eclipse中直接執行此操作,您需要創建一個自定義Maven Build。進入「運行>運行配置...」。雙擊「Maven Build」創建一個新的自定義Maven構建。給它一個名字,選擇基本目錄到您正在嘗試構建的項目的工作目錄,選擇目標「乾淨安裝」和配置文件「bootstrap」。

第一次構建完成後,在Eclipse中更新Maven項目,您將不再有任何錯誤。

+0

我需要閱讀更多,謝謝 – arnoldssss

+0

男人我只是在刪除所有.m2文件夾後發出命令,但似乎有錯誤...我更新了帖子。 – arnoldssss

+0

@arnoldssss查看我的編輯,添加'-DskipTests = true' – Tunaki