0

How to add exclusions in gitlab pipeline using jacoco with ant for code coverage of java in gitlab? we are not using sonar.

Is there any direct command/property to add exclusions in gitlab? just direct property like sonar as below -Dsonar.coverage.exclusions="/testsrc/,/soap/,Exception.java"

1 Answer 1

0

In your jacoco:report Ant task, you can use <exclude> patterns to exclude class files that you don't want included in your coverage reports:

<jacoco:report>
    <!-- ... -->
    <structure name="Your Project">
        <classfiles>
            <fileset dir="classes">
                <exclude name="**/soap/**"/>
                <exclude name="**/Exception.class"/>
            </fileset>
        </classfiles>
        <sourcefiles>
            <fileset dir="src"/>
        </sourcefiles>
    </structure>
    <!-- ... -->
</jacoco:report>

For more information, see FileSet in the Ant manual.

Sign up to request clarification or add additional context in comments.

Comments

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.