-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Use CFS as the package resolution source #47901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the Azure SDK for Java build infrastructure from using Sonatype OSSRH to Azure Artifacts (CFS) for Maven package resolution and distribution. The changes ensure that all Maven builds authenticate with Azure Artifacts using Azure DevOps system access tokens.
Changes:
- Updated Maven parent POMs to use Azure Artifacts as the central repository
- Configured Maven settings.xml with mirror and authentication for Azure Artifacts
- Added SYSTEM_ACCESSTOKEN environment variable to pipeline jobs and Maven tasks
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/parents/clientcore-parent/pom.xml | Updated repositories, pluginRepositories, and distributionManagement to use Azure Artifacts feed |
| sdk/parents/azure-sdk-parent/pom.xml | Updated repositories and pluginRepositories to use Azure Artifacts feed |
| sdk/parents/azure-client-sdk-parent/pom.xml | Updated repositories, pluginRepositories, and distributionManagement to use Azure Artifacts feed |
| sdk/parents/azure-client-sdk-parent-v2/pom.xml | Updated repositories, pluginRepositories, and distributionManagement to use Azure Artifacts feed |
| sdk/clientcore/annotation-processor/pom.xml | Removed duplicate repository/distributionManagement configurations (now inherited from parent) |
| eng/settings.xml | Configured Maven mirror and server authentication using SYSTEM_ACCESSTOKEN environment variable |
| eng/pipelines/templates/variables/globals.yml | Added SYSTEM_ACCESSTOKEN global variable for pipeline authentication |
| eng/pipelines/templates/steps/run-and-validate-linting.yml | Removed obsolete comment |
| eng/pipelines/templates/steps/build-and-test.yml | Added SYSTEM_ACCESSTOKEN to all Maven task environments |
| eng/pipelines/templates/steps/build-and-test-native.yml | Added SYSTEM_ACCESSTOKEN to all Maven task environments |
| eng/pipelines/templates/jobs/native.live.tests.yml | Added SYSTEM_ACCESSTOKEN job variable |
| eng/pipelines/templates/jobs/live.tests.yml | Added SYSTEM_ACCESSTOKEN job variable |
| eng/pipelines/templates/jobs/ci.yml | Added SYSTEM_ACCESSTOKEN job variables to Build and Analyze jobs |
| eng/pipelines/templates/jobs/build-validate-pom.yml | Added SYSTEM_ACCESSTOKEN job variable |
|
@srnagar @alzimmermsft based on my search in the java repo, there is only one package references the snapshot version, i.e. microsoft-azure-batch. Could you evaluate whether we can replace it by a released version? |
|
@raych1, unfortunately there isn't a replacement for |
| jdkVersionOption: $(JavaBuildVersion) | ||
| jdkArchitectureOption: 'x64' | ||
| publishJUnitResults: false | ||
| env: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? Can't we just do an authenticate step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <id>central</id> | ||
| <name>Azure Artifacts Maven Mirror</name> | ||
| <url>https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-java/maven/v1</url> | ||
| <mirrorOf>*,!confluent</mirrorOf> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weshaggard this is the only place using the confluent upstream which is not available in azure artifacts. Let me ask maven CFS support if we can add it to upstream source.
| <url>https://packages.confluent.io/maven/</url> |
The Credential provider docs also suggests using MavenAuthenticate@0 task in pipeline scenarios.
Resolved #47751
Key changes:
The
SYSTEM_ACCESSTOKENvariable is set as env variables to provide the authentication tokenUpdated
eng/settings.xmlto configure Maven to use theSYSTEM_ACCESSTOKENenvironment variable for authenticating and mirror settingsModified all parent POMs (
azure-sdk-parent,azure-client-sdk-parent,azure-client-sdk-parent-v2) and separated service's POMs to remove references to Sonatype OSSRH and use the Azure Artifacts Maven feed as the central repository