Skip to content

CI CD: Azure DevOps

yucwan edited this page Dec 31, 2019 · 1 revision

To use Azure Maven plugins in Azure DevOps, you are recommended to use Service Principle in setting.xml for authentication. Then, the only prerequisite is to upload the setting.xml to Secure File.

pool:
  name: Azure Pipelines
  demands: maven
steps:

# download settings.xml from secure file
- task: DownloadSecureFile@1
  inputs:
    secureFile: settings.xml

# apply the settings
- powershell: |
   New-Item -Type Directory -Force "${HOME}/.m2"
   Copy-Item -Force "$(setting.secureFilePath)" "${HOME}/.m2/settings.xml"

# use maven goals to deploy
- task: Maven@3
  inputs:
    mavenPomFile: 'pom.xml'
    goals: 'clean package azure-spring-cloud:deploy'
Clone this wiki locally