我在我的settings.xml中有3個倉庫,因爲我需要所有這些倉庫的工件。每當找不到依賴,Maven的嘗試如何在Maven settings.xml中設置倉庫的順序
Downloading: http://some.server/mvn2repo/releases/org/apache/lucene/lucene-core/2.9.1/...
[INFO] Unable to find resource 'org.apache.lucene:lucene-core:pom:2.9.1' in repository
Downloading: http://some.server/mvn2repo/3rdParty/org/apache/lucene/lucene-core/2.9.1/...
[INFO] Unable to find resource 'org.apache.lucene:lucene-core:pom:2.9.1' in repository
Downloading: http://repo1.maven.org/maven2/org/apache/lucene/lucene-core/2.9.1/lucene-core-2.9.1.pom
<success>
所有存儲庫,但大部分時間都在集中(repo1)神器當然。我希望Maven先檢查這個回購。我在settings.xml中嘗試了聲明的順序,但沒有奏效。根據fgysin我也試過相反的順序,這並沒有改變任何東西。
我的Maven的版本:
C:\>mvn -v
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_15
Java home: C:\Program Files\Java\jdk1.6.0_15\jre
Default locale: de_AT, platform encoding: Cp1252
OS name: "windows vista" version: "6.0" arch: "amd64" Family: "windows"
我settings.xml
<profiles>
<profile>
<id>space</id>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>s1-releases</id>
<name>System One Releases</name>
<url>http://some.server/mvn2repo/releases</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>s1-3rdParty</id>
<name>System One 3rd Party Releases</name>
<url>http://some.server/mvn2repo/3rdParty</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>space</activeProfile>
</activeProfiles>
讓我們投票選出了以下問題:http://jira.codehaus.org/browse/MNG-4946和http://jira.codehaus.org/browse/MNG- 4400 – 2013-05-27 07:12:56
只需選擇一個工作回購和'只'配置它... – smwikipedia 2015-12-12 09:44:45
@HendyIrawan似乎MNG-4400已修復與maven 3.0 FWIW – rogerdpack 2016-05-10 19:54:11