0

I have a Maven Multi-Module Build. This works fine in the Azure Build Pipeline. Now I try to add CodeCoverage Report. For that I added this to my azure-pipelines.yml

- task: PublishCodeCoverageResults@2
  displayName: 'Publish code coverage report'
  inputs:
    codeCoverageTool: 'JaCoCo'
    summaryFileLocation: '**/target/site/jacoco/jacoco.xml'
    reportDirectory: '**/target/site/jacoco'
    failIfCoverageEmpty: false
    pathToSources: '$(System.DefaultWorkingDirectory)/**/src/main/java/'

then in the two Maven module I added this

  <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
                <!-- attached to Maven test phase -->
                <execution>
                    <id>report</id>
                    <phase>test</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

I get this output in the target

enter image description here

The same I did in another module.

Note my verion for all modules is 1.1.3

The problems is now when the Build runs in Azure Pipeline. I see this:

enter image description here

enter image description here

The Version 1.0-SNAPSHOT does not exist in my project.

Do you have an idea what the problem is?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.