Our enterprise team maintains a settings.xml file that defines various repositories that development teams can use with Maven to build their artifacts.
<repositories>
<repository>
<id>repo_1</id>
<name>repo_1</name>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>interval:15</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<url>https://repo1.url.com</url>
<layout>default</layout>
</repository>
<repository>
<id>repo_2</id>
<name>repo_2</name>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>https://repo2.url.com</url>
<layout>default</layout>
</repository>
</repositories>
Here is my issue: I’d like development teams to phase out the use of repo1 and begin using repo2. However I do not want to force it and would like them to do it over time before I remove repo1 references from the settings.xml file.
Is there a way to do this other than creating separate profiles in the settings.xml file and having the developers deactivate them using the mvn -P=-profilename command?
I basically need to change the order of the repositories to query repo 2 first instead of visa versa
Tried changing in the order in the pom.xml but to no avail
Fearghal Coyne is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.