In Azure Devops Maven build pipeline, while building multi-module java project, the build was successful.
However, the Jacoco code coverage is failing with below error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (default) on project VstsReport: An Ant BuildException has occured: Unable to read execution data file /vsts/agent/_work/8/s/CCReport43F6D5EF/jacoco.exec
2020-01-02T22:17:12.5100407Z [ERROR] around Ant part ...... @ 8:11 in /vsts/agent/_work/8/s/target/antrun/build-main.xml: /vsts/agent/_work/8/s/CCReport43F6D5EF/jacoco.exec (No such file or directory)
Azure pipeline yml file has the following task parameters:
task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
goals: 'package'
options: '--settings settings.xml'
codeCoverageToolOption: JaCoCo
codeCoverageSourceDirectories: epubcheck-service/src/main,epubcheck-service/src/test
codeCoverageClassFilesDirectories: epubcheck-service/target/classes,epubcheck-service/target/test-classes
sonarQubeRunAnalysis: true
If I comment the codeCoverage parameters then the Maven build task completes successfully. Only when I add the codeCoverage parameters on a multi-module project, I am getting the above-mentioned error.
Can somebody who used Azure DevOps pipeline for building Java maven build and Jacoco code coverage tool help me?