2011-12-04 23 views
0

我想在Jenkins設置一個Maven2作業。我在我的pom.xml中有這樣幾行:如何指定Jenkins作業的內部公司Maven回購使用?

<distributionManagement> 
    <repository> 
    <id>releases</id> 
    <name>Releases</name> 
    <url>http://nexus.example.com:8081/nexus/content/repositories/releases</url> 
    </repository> 
    ... 
</distributionManagement> 

我在嘗試建設工作時,這個錯誤:

... 
Downloading: http://repo1.maven.org/maven2/.../.../.../....jar 
[INFO] Unable to find resource 'resource id goes here' in repository central (http://repo1.maven.org/maven2) 
... 
[ERROR] BUILD ERROR 
[INFO] ------------------------------------------------------------------------ 
[INFO] Failed to resolve artifact. 

Missing: 
...Here goes the list of missing dependencies. 

我知道肯定所需的構件做關係存在。 example.com存儲庫,因爲我可以在我的工作站上執行mvn compile,並且它們將被下載成功。

但由於某些原因,Jenkins甚至不會嘗試從本地回購下載工件,而忽略pom.xml中的規範。

任何想法我可以嘗試什麼?

回答

1

您可以通過兩種方式解決此錯誤。

一,將<repositories>部分移出<distributionManagement><distributionManagement>部分用於指示您想要在哪裏部署您的工件。

指定部分中settings.xml的用戶名jenkins正在運行。這是建議的,因爲這將適用於您將要構建的所有項目。

+0

我已經想通了,我可以在jenkins的settings.xml中指定的東西。那就是訣竅。但我認爲你的想法也會有幫助。謝謝! – vadipp

相關問題