title: Azure DevOps Build Pipeline - Build Spring Boot based on specific application.profile
body: <p>I have a Spring Boot application and I make use of Azure DevOps to automatically build/test the project and deploy the artifact.</p>
  
  <p>My question is as follows: How can I build based on a specific application.profile? Right now it just builds but in my project I have the following 3 files:</p>
  
  <ul>
  <li>application.properties</li>
  <li>application-test.properties</li>
  <li>application-acceptance.properties</li>
  </ul>
  
  <p>How can I for example build based on "application-test.properties"?</p>
  
  <p>Currently my code looks like this:</p>
  
  <pre><code>stages: 
   - stage: Build
  displayName: Build stage
    jobs:
   - job: MavenPackageAndPublishArtifacts
  displayName: Maven Package and Publish Artifacts
  pool:vmImage: $(vmImageName)
  
  steps:
  - task: Maven@3
    displayName: 'Maven Package'
    inputs:
      mavenPomFile: 'pom.xml'
      javaHomeOption: 'JDKVersion'
      jdkVersionOption: '1.11'
      jdkArchitectureOption: 'x64'
  
  - task: CopyFiles@2
    displayName: 'Copy Files to artifact staging directory'
    inputs:
      SourceFolder: '$(System.DefaultWorkingDirectory)'
      Contents: '**/target/*.?(war|jar)'
      TargetFolder: $(Build.ArtifactStagingDirectory)
  
  - upload: $(Build.ArtifactStagingDirectory)
    artifact: drop
  </code></pre>