Jacoco排除班级 [英] Jacoco exclude classes

查看:174
本文介绍了Jacoco排除班级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在尝试使用jacoco排除我的代码覆盖率的类。我想要排除gui文件夹及其中的所有类。

Hi I am trying to exclude classes for my code coverage using jacoco. I want to exclude the gui folder and all the classes inside it.

   <configuration>
      <excludes>
          <exclude>com.project/folder/tools/gui/*.class</exclude>
      </excludes>
      </configuration>

com.project - >文件夹 - >工具 - > gui

com.project -> folder -> tools -> gui

我尝试了很多不同的路径但由于某种原因它不会排除任何路径。
我这样做错了吗?
任何人都可以指出我正确的方向。

I have tried many different paths but for some reason it wont exclude any of them. Am I doing this wrong? Can anyone point me in the right direction.

推荐答案

Maven包含/排除语法是Ant。所以我建议你看看文件集文档,你可以在那里找到一些说明性示例。

Maven include/exclude syntax is Ant. So I suggest you to have a look on fileset documentation, where you can find few illustrative examples.

在您的特定配置中,它可以使用此模式

In your particular configuration, it could work this pattern

**/gui/**

假设您不使用包名gui 在其他情况下。

assuming that you don't use the package name "gui" in other context.

这篇关于Jacoco排除班级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆