Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to exclude package at time of cobertura report generation? #16

Open
iamgauravkhanna opened this issue Apr 7, 2016 · 2 comments

Comments

@iamgauravkhanna
Copy link

Hi,

After instrumentation is complete, i am creating reports using cobertura-report.bat.

Is there any way that i can exclude package at time of cobertura report generation?

@sapirgolan
Copy link

You can exclude packages from total code coverage if you are using the MVN plugin
http://www.mojohaus.org/cobertura-maven-plugin/usage.html

@wognin
Copy link

wognin commented Aug 29, 2016

I have the same problem concerning the ignore of class "javax/resource/ResourceException".

During intrumentation of my class using the Java EE class javax/resource/ResourceException, I get this error :
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/resource/ResourceException

I've followed the link above "http://www.mojohaus.org/cobertura-maven-plugin/usage.html" with this configuration in my pom.xml (juste to try to ignore the only class javax.resource.ResourceException)

  <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>cobertura-maven-plugin</artifactId>
      <version>**2.7**</version>
      <configuration>
        <instrumentation>
           <ignores>
             <ignore>javax/**/*.*</ignore>
             <ignore>**/ResourceException.class</ignore>
             <ignore>**/ResourceException</ignore>
             <ignore>**/ResourceException.*</ignore>
             <ignore>.*javax.*</ignore>
             <ignore>javax.*</ignore>
             <ignore>.*ResourceException.*</ignore>
             <ignore>javax.resource.ResourceException</ignore>
             <ignore>javax.resource.ResourceException.*</ignore>
             <ignore>.*javax.resource.ResourceException.*</ignore>
           </ignores>
        </instrumentation>
      </configuration>
  </plugin>

But none of these ignores doesn't work. The error is still displayed and the coverage is note calculated for the class using the Java EE class javax.resource.ResourceException.

Thanks for your help.

Best regards,
WOGNIN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants