title: setting up a maven pipeline for a sub directory in a single-repository in Azure Repo git
body: <p>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.</p>
  
  <p>working on ubuntu/windows we compile fine using the following command:<code>mvn package -Dmaven.test.skip=true -e -X</code>
  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.</p>
  
  <p>as such, i have modified the .yml file as follow:</p>
  
  <pre><code># Build your Java project and run tests with Apache Maven.
  # Add steps that analyze code, save build artifacts, deploy, and more:
  # https://docs.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'
  </code></pre>
  
  <p>which is pretty much what the yml file they give you, excpet i change the lines:</p>
  
  <p><code>mavenPomFile: 'ContentResolver/pom.xml'</code> to be relative</p>
  
  <p>and <code>mavenOptions: '-Dmaven.test.skip=true'</code> becuase for now the ADO do not recognize <code>-e -X</code> but i will fix this later.</p>
  
  <p>and the paths from the log itself:</p>
  
  <p><code>Failed to read schema document 'file:/home/vsts/work/1/s/src/main/resources/model.xsd'</code></p>
  
  <p><code>/home/vsts/work/1/s/src/main/resources/configuration.xsd (No such file or directory)</code></p>
  
  <p>which means i need to change some other variable to point the maven to look for model and configuraiton in <code>ContentResolver/src/...</code> instead of directly in src.</p>
  
  <p>i have not found such a way. i tried to change to following:</p>
  
  <p>$(Agent.BuildDirectory)=ContentResolver</p>
  
  <p>$(Agent.WorkFolder)=ContentResolver</p>
  
  <p>$(Build.SourcesDirectory)=ContentResolver</p>
  
  <p>but none of those helped me.</p>