Maven "Mirror Any" explanation and configuration.

Maven "Mirror Any" explanation and configuration.

AuthorFullName__c
JFrog Support
articleNumber
000001392
ft:sourceType
Salesforce
FirstPublishedDate
2016-10-06T13:38:22Z
lastModifiedDate
2024-03-10T07:48:55Z
VersionNumber
5

The "Mirror Any" proxy configuration works for defined repositories. It supersedes, but does not hide, the built-in central and snapshots repositories, unless overridden by the user.It defines a coarse-grained proxy rule that does not differentiate between releases and snapshots and relies on the defined repositories to do this resolution filtering.

Our recommendation is to use 2 virtual repositories in Artifactory (not a must, you can use required repo only), the first will aggregate all release repositories and the second will aggregate the snapshots.

Then, configure your settings.xml file with the mirror as follow:

<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://localhost:8081/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://localhost:8081/artifactory/libs-snapshot</url>
</repository>
</repositories>



Please note: Artifactory can automatically generate your settings.xml. Please read more about this here.