0
我在本地運行JFrog's Artifactory,在此處我將工件上傳到默認的libs-snapshot-local
存儲庫。還配置爲使用JCenter作爲遠程存儲庫。
Maven是配置了以下的settings.xml:Maven本地鏡像
<settings>
<mirrors>
<mirror>
<id>jcenter</id>
<name>jcenter</name>
<url>http://172.18.0.1:8081/artifactory/jcenter</url>
<mirrorOf>*,!libs-snapshot-local</mirrorOf>
</mirror>
<mirror>
<id>libs-snapshot-local</id>
<name>libs-snapshot-local</name>
<url>http://172.18.0.1:8081/artifactory/libs-snapshot-local</url>
<mirrorOf>libs-snapshot-local</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<repositories>
<repository>
<id>jcenter</id>
<name>jcenter</name>
<url>http://172.18.0.1:8081/artifactory/jcenter</url>
<snapshots><enabled>false</enabled></snapshots>
</repository>
<repository>
<id>libs-snapshot-local</id>
<name>libs-snapshot-local</name>
<url>http://172.18.0.1:8081/artifactory/libs-snapshot-local</url>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jcenter</id>
<name>jcenter</name>
<url>http://172.18.0.1:8081/artifactory/jcenter</url>
<snapshots><enabled>false</enabled></snapshots>
</pluginRepository>
<pluginRepository>
<id>libs-snapshot-local</id>
<name>libs-snapshot-local</name>
<url>http://172.18.0.1:8081/artifactory/libs-snapshot-local</url>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
當我運行編譯過程不幸的Maven似乎從JCenter拉的一切:偶數雖然這神器,根據
[INFO] Downloading: http://172.18.0.1:8081/artifactory/jcenter/org/apache/maven/plugins/maven-javadoc-plugin/2.10.4/maven-javadoc-plugin-2.10.4.jar
Artifactory,在libs-snapshot-local
之內。
它怎麼沒有先使用本地的,有沒有辦法解決這個問題?
原因是因爲當我在Artifactory中使用虛擬存儲庫時,它似乎甚至會緩存所有內容 - 儘管它對於遠程存儲庫是關閉的。這是我根本不想要的,因爲我正在使用它來做一些我明確測試所需時間的東西。另一種選擇是使用多個Artifactory實例,但確實會給系統帶來沉重的負擔。我會嘗試將其他默認存儲庫鏈接到libs-snapshot-local,並查看是否會更改某些內容。 – Hering
爲什麼要測試工件下載需要多長時間? –
Artifactory中的緩存或存儲庫管理器中的緩存是有意的,並且是其中的基礎概念之一?你想解決什麼樣的問題? – khmarbaise