Maven Findbugs plugin - How to run findbug on the test classes

后端 未结 1 1942
被撕碎了的回忆
被撕碎了的回忆 2021-01-02 07:39

Maven version: 3.3.3. Findbugs plugin version: 3.0.1

  1. I\'m using the findbugs-maven-plugin and I need to run findbugs plugin on src and test cla

1条回答
  •  盖世英雄少女心
    2021-01-02 08:15

    In the configuration of the findbugs-maven-plugin, you need to explicitely set the includeTests element to true for FindBugs to analyze the test classes:

    
      org.codehaus.mojo
      findbugs-maven-plugin
      3.0.1
      
        
        true
      
    
    

    Also, the plugin should be bound to the verify phase so that FindBugs is executed after compilation of source and test classes.

    For the maven-pmd-plugin, it is actually the same: the element includeTests must be set to true in the plugin configuration.

    0 讨论(0)
提交回复
热议问题