Search code examples
javaspringjunitjacocotest-coverage

How to ignore test coverage from data model and dto from Java spring boot project


How can I ignore all model files and dto files from test coverage ? I use junit to write unit test in my project. All methods and classes has been coverage except model and dto files. The coverage of each class is very high but the project is low litter bit because all model and dto file. How can I ignore them to set the test coverage is higher ?


Solution

  • Check these references, shows how you need to set your exclusions in jacoco plugin

    maven-jacoco-config

    gradle-jacoco-config