From c3eaf5d47e47dc98017fca184cdca8ab268c821d Mon Sep 17 00:00:00 2001 From: "Gavin Barron (from Dev Box)" Date: Tue, 4 Aug 2026 16:56:09 -0700 Subject: [PATCH] Use Maven task in release pipeline Replace Maven wrapper invocations with Maven@4 tasks so network-isolated builds use the hosted Maven installation and authenticated Azure Artifacts mirror. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 94192e5b-ed23-41af-8495-a1b4a0f9689e --- .azure-pipelines/ci-build.yml | 40 +++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 8f2012e22a2..9a362c30b02 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -101,21 +101,53 @@ extends: inputs: artifactsFeeds: 'GraphDeveloperExperiences_Public' - - script: ./mvnw install -Psigning --no-transfer-progress + - task: Maven@4 displayName: Publish to local Maven for verification condition: contains(variables['build.sourceBranch'], 'refs/tags/v') + inputs: + mavenPomFile: 'pom.xml' + goals: 'install' + options: '-Psigning --no-transfer-progress' + publishJUnitResults: false + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.21' + jdkArchitectureOption: 'x64' - - script: ./mvnw install -Psigning --no-transfer-progress + - task: Maven@4 displayName: Publish to local Maven for verification condition: not(contains(variables['build.sourceBranch'], 'refs/tags/v')) + inputs: + mavenPomFile: 'pom.xml' + goals: 'install' + options: '-Psigning --no-transfer-progress' + publishJUnitResults: false + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.21' + jdkArchitectureOption: 'x64' - - script: ./mvnw deploy -Psigning --no-transfer-progress -DaltDeploymentRepository=ADO::default::file://$(Build.SourcesDirectory)/target/staging-deploy + - task: Maven@4 displayName: Stage artifacts for ESRP condition: contains(variables['build.sourceBranch'], 'refs/tags/v') + inputs: + mavenPomFile: 'pom.xml' + goals: 'deploy' + options: '-Psigning --no-transfer-progress -DaltDeploymentRepository=ADO::default::file://$(Build.SourcesDirectory)/target/staging-deploy' + publishJUnitResults: false + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.21' + jdkArchitectureOption: 'x64' - - script: ./mvnw deploy -Psigning --no-transfer-progress -DaltDeploymentRepository=ADO::default::file://$(Build.SourcesDirectory)/target/staging-deploy + - task: Maven@4 displayName: Stage artifacts for ESRP condition: not(contains(variables['build.sourceBranch'], 'refs/tags/v')) + inputs: + mavenPomFile: 'pom.xml' + goals: 'deploy' + options: '-Psigning --no-transfer-progress -DaltDeploymentRepository=ADO::default::file://$(Build.SourcesDirectory)/target/staging-deploy' + publishJUnitResults: false + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.21' + jdkArchitectureOption: 'x64' - pwsh: | $pomXml = [xml](Get-Content pom.xml -Raw)