Settings.xml
<settings>
<servers>
<id>...</id>
<username>...</username>
<password>...</password>
<servers>
<mirrors>
<mirror>
<id>yale-repo</id>
<mirrorOf>*</mirrorOf>
<url>https://repository.its.yale.edu/maven2/repo</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>yale-repo-override-central</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to the yale-repo via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>yale-repo-override-central</activeProfile>
</activeProfiles>
</settings>
Explanation
We override central with snapshots enabled and a dummy url to central. We do this so that ALL artifacts, regardless, are resolved through our repository. This prevents having to define the repository in every pom.xml of every project or in a larger parent pom.
Note the addition of <updatePolicy>always</updatePolicy> to the <snapshots> tag. This forces all snapshots to be downloaded from the central repository each time a build requiring a snapshot is executed instead of the default of once per day.
Labels
(None)