Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Findbugs exclude generated files

I am trying to filter out the generated files from the findbugs check and all I tried does not seem to work. Pretty much part of my build process I create a whole lot of classes that end up in a folder called src/generated I would be interested in filtering out all those classes. I am using maven but I don't think it matters.

Thank you in advance.

like image 983
Julian Avatar asked Aug 20 '12 23:08

Julian


Video Answer


1 Answers

Without knowing what you tried it's a bit problematic to help.

Here's a fragment we use to skip over a few bug patterns present in code generated by Avro.

<FindBugsFilter>
  <Match>
    <!-- Avro generates redundant "implements" interface declarations -->
    <Or>
      <Package name="~com[.]foo[.]plugh[.]avro([.].*)?"     />
      <Package name="~com[.]foo[.]xyzzy[.]protocol([.].*)?" />
    </Or>

    <Or>
      <Bug pattern="RI_REDUNDANT_INTERFACES" />
      <Bug pattern="NM_CLASS_NAMING_CONVENTION" />
      <Bug pattern="REC_CATCH_EXCEPTION" />
    </Or>
  </Match>
</FindBugsFilter>
like image 84
Dave Newton Avatar answered Sep 21 '22 08:09

Dave Newton