2

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
Sara June
  • 451
  • 1
  • 9
  • 28

1 Answers1

0

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
Souf
  • 101
  • 1