Score:1

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

cn flag

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
Score:0
us flag

If your pipeline is cloning multiple projects for example, you can execute your maven on a specific project by defining where your pom.xml is. This results in the same behaviour as browsing to that project. Following is your step example modified :

- task: Maven@3
  inputs:
    mavenPomFile: 'path/to/your/project/pom.xml'
    goals: 'clean package'
    options: '-DbuildDirectory=VaultService'
    publishJUnitResults: false
    javaHomeOption: 'JDKVersion'
    mavenVersionOption: 'Default'
    mavenAuthenticateFeed: false
    effectivePomSkip: false
    sonarQubeRunAnalysis: false
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.