We started to work with ADOgit repo. As part of the move we would like to build some projects directly in ado - as a first effort we decided to create a pipeline for a standard Java Server that is built with maven.
working on ubuntu/windows we compile fine using the following command:mvn package -Dmaven.test.skip=true -e -X
as the the new git repo in ado is a single repo for multiple projects, the java project, called "ContentResolver" is not the root of the repo but a sub dir.
as such, i have modified the .yml file as follow:
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/java
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Maven@3
inputs:
mavenPomFile: 'ContentResolver/pom.xml'
mavenOptions: '-Dmaven.test.skip=true'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.7'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'package'
which is pretty much what the yml file they give you, excpet i change the lines:
mavenPomFile: 'ContentResolver/pom.xml'
to be relative
and mavenOptions: '-Dmaven.test.skip=true'
becuase for now the ADO do not recognize -e -X
but i will fix this later.
and the paths from the log itself:
Failed to read schema document 'file:/home/vsts/work/1/s/src/main/resources/model.xsd'
/home/vsts/work/1/s/src/main/resources/configuration.xsd (No such file or directory)
which means i need to change some other variable to point the maven to look for model and configuraiton in ContentResolver/src/...
instead of directly in src.
i have not found such a way. i tried to change to following:
$(Agent.BuildDirectory)=ContentResolver
$(Agent.WorkFolder)=ContentResolver
$(Build.SourcesDirectory)=ContentResolver
but none of those helped me.