Conversation
There was a problem hiding this comment.
Pull request overview
This PR centralizes Maven repository routing in CI by introducing a shared Maven settings.xml mirror configuration (CFS) and removing per-module <repositories> / <pluginRepositories> overrides from various POMs so Maven Central traffic is consistently redirected.
Changes:
- Added
eng/settings.xmlwith a Maven mirror pointing external resolution to the Azure Artifacts feed. - Updated CI Maven authentication step to install the shared
settings.xmlinto the default~/.m2/settings.xmlbefore runningMavenAuthenticate@0. - Removed redundant repository and pluginRepository configuration blocks from affected BOMs, parents, and Spring starter modules; updated contributor docs for local usage.
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/spring/spring-cloud-azure-starter/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-stream-servicebus/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-stream-eventhubs/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-storage/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-storage-queue/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-storage-file-share/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-storage-blob/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-servicebus/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-keyvault/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-keyvault-secrets/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-keyvault-jca/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-keyvault-certificates/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-jdbc-postgresql/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-jdbc-mysql/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-integration-storage-queue/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-integration-servicebus/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-integration-eventhubs/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-eventhubs/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-eventgrid/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-data-redis-lettuce/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-data-cosmos/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-cosmos/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-appconfiguration/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-appconfiguration-config/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-actuator/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-active-directory/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/spring/spring-cloud-azure-starter-active-directory-b2c/pom.xml | Removes per-module repositories/pluginRepositories in favor of mirror-based resolution. |
| sdk/parents/clientcore-parent/pom.xml | Removes parent-level repositories/pluginRepositories overrides (previously used to route/disable Central). |
| sdk/parents/azure-sdk-parent/pom.xml | Removes parent-level repositories/pluginRepositories overrides (previously used to route/disable Central). |
| sdk/boms/spring-cloud-azure-dependencies/pom.xml | Removes BOM-level repositories/pluginRepositories overrides in favor of mirror-based resolution. |
| sdk/boms/azure-sdk-template-bom/pom.xml | Removes BOM-level repositories/pluginRepositories overrides in favor of mirror-based resolution. |
| sdk/boms/azure-sdk-bom/pom.xml | Removes BOM-level repositories/pluginRepositories overrides in favor of mirror-based resolution. |
| eng/settings.xml | Adds centralized Maven mirror configuration for CI/local opt-in. |
| eng/pipelines/templates/steps/maven-authenticate.yml | Copies shared settings.xml into ~/.m2/settings.xml before MavenAuthenticate to enforce mirroring. |
| CONTRIBUTING.md | Documents how to use the new mirror settings locally (copy or --settings). |
| steps: | ||
| # Copy mirror settings to default Maven location so all requests go through CFS | ||
| - pwsh: | | ||
| $m2Dir = if ($env:USERPROFILE) { "$env:USERPROFILE\.m2" } else { "$HOME/.m2" } |
There was a problem hiding this comment.
The pipeline steps use $(MAVEN_CACHE_FOLDER) from https://github.com/Azure/azure-sdk-for-java/blob/main/eng/pipelines/templates/variables/globals.yml#L25 I think we would want to point it to that parent? ($(Pipeline.Workspace)/.m2).
There was a problem hiding this comment.
@benbp maven-authenticate task can only write secret to the default setting file. Given $(Pipeline.Workspace) might have more storage, I'd rather keep the package cached folder and settings file in separate places as is now.
https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/maven-authenticate-v0?view=azure-pipelines#where-is-the-settingsxml-file-containing-the-authenticated-repositories-located
|
@raych1 I thought we were going to keep what we had and only add the copy of the settings mirror for pipelines. I would like local development to use the CFS feed for most cases and the only exception is those maven tools that don't respect the override and need the mirror. |
weshaggard
left a comment
There was a problem hiding this comment.
I would like to understand if we need to do a full revert. I was hoping it would only be copy the mirror settings if you needed to resolve the maven tool extensions from the CFS feed but everything else would still use CFS by default.
Keep <repositories> and <pluginRepositories> blocks in POMs so local development continues to route through CFS (no-auth) by default. The CI mirror settings in eng/settings.xml handle the tools/extensions that don't respect POM-level repos.
|
|
||
| ##### Matching CI behavior locally | ||
|
|
||
| After setting up the credential provider above, you can route all Maven traffic through the Azure Artifacts feed locally by copying the mirror settings: |
There was a problem hiding this comment.
We should at least add a note as to why this is needed. Something like all maven traffic is already using the CFS feed by default expect for the maven plugins and to get them to use the feed you need to do this.
weshaggard
left a comment
There was a problem hiding this comment.
One note about docs but otherwise this is what I was expecting.
We're still seeing traffics to the maven central in pipeline runs. The reason is the super pom resolves the plug-in installation to the maven central website. The repository override settings in the parent POM and project level POM won't intercept this kind of traffic. The right approach is to use the mirror settings to redirect all the traffics to maven central.
Now we use mirror settings approach for CI scenario. Meanwhile, we keep using repository override approach for local scenarios so that maven packages should be installed from CFS except maven plug-ins.
Changes
Centralized Maven Mirror Configuration:
eng/settings.xmlfile that defines the Azure Artifacts mirror, replacing per-module repository and pluginRepository blocks.eng/pipelines/templates/steps/maven-authenticate.yml) to copy the sharedsettings.xmlto the default Maven location, ensuring all Maven requests in CI use the CFS mirror.Documentation Updates:
CONTRIBUTING.mdto provide instructions for using the CFS mirror locally, including how to copy or reference the sharedsettings.xmlfor local builds.