How to build maven project from another folder in azure devops pipeline?

Uday Kiran Reddy (ureddy) 96 Reputation points
2021-12-23T18:33:10.99+00:00

In github actions, we can set this using

- name: Build with Maven
  working-directory: ./VaultService
  run: mvn clean package --file pom.xml
  env:
    CI: false

But there is no working-directory option in azure devops.

Even I tried below one, but it is not building in the VaulService folder.

- task: Maven@3
  inputs:
    mavenPomFile: 'pom.xml'
    goals: 'clean package'
    options: '-DbuildDirectory=VaultService'
    publishJUnitResults: false
    javaHomeOption: 'JDKVersion'
    mavenVersionOption: 'Default'
    mavenAuthenticateFeed: false
    effectivePomSkip: false
    sonarQubeRunAnalysis: false
Azure DevTest Labs
Azure DevTest Labs
An Azure service that is used for provisioning development and test environments.
291 questions
Azure Lab Services
Azure Lab Services
An Azure service that is used to set up labs for classrooms, trials, development and testing, and other scenarios.
308 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2021-12-23T18:36:02.683+00:00

    The product group for Azure DevOps / TFS actively monitors questions over at
    https://developercommunity.visualstudio.com/report?space=21&entry=problem
    https://developercommunity.visualstudio.com/report?space=22&entry=problem

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.