Search code examples
azuremavenazure-devopsdevopspom.xml

Maven POM file not found in AzureDevOps pipeline


I get the following error: problem picture

It says that the POM file can't be found. I have my yaml file within my github project like this: Project picture

My yaml file looks like this: In my github there is a pom file in a folder called dataops/poms/pom.xml so i don't know why it can't find it.

    # Talend CI/CD on Azure DevOps
# Build Pipeline for building and publishing on Talend Cloud

trigger: none

pool:
 vmImage: 'ubuntu-latest'

variables:
- group: Talend Configuration
- name: project_name
  value: 'DataOps'
- name: job_name
  value: 'Soccer_api_Call'
- name: job_version
  value: '0.1'

steps:
  - task: DownloadSecureFile@1
    name: settings_xml
    inputs:
      secureFile: settings.xml

  - task: DownloadSecureFile@1
    name: license_txt
    inputs:
      secureFile: license.txt

  - task: Maven@3
    inputs:
        mavenPomFile: '$(project_name)/poms/pom.xml' 
        mavenOptions: |
          -Dlicense.path=$(license_txt.secureFilePath)
          -Dupdatesite.path=$(UPDATESITE_PATH)
          -Dservice.url=$(CLOUD_URL)
          -Dcloud.publisher.screenshot=true
          -Xmx3096m -Xmx1024m
        options: '--settings $(settings_xml.secureFilePath) -Pcloud-publisher -pl jobs/process/$(job_name)_$(job_version) -am'
        goals: 'deploy'

Any help is much appreciated!!


Solution

  • We recommend you can try to use the mavenPomFile: 'DATAOPS/poms/pom.xml' instead of the mavenPomFile: '$(project_name)/poms/pom.xml'. On my test, I create a demo like your yaml, and it works well with the full path: enter image description here enter image description here

    Please ignore the test result, it just uses to check if the task can find the pom.xml.