2015-12-15 27 views

回答

2

我通常把它们放在一个单独的父pom中,这样我可以在以后的其他模块或项目中重用它们。 类似于checkstyle页面上的提议(https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html),但我将其保留在主项目之外。

您将文件命名中,你的src /主/资源/你/包的CheckStyle和PMD的配置,然后配置给插件与build-tools模块:

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-checkstyle-plugin</artifactId> 
    <version>2.17</version> 
    <dependencies> 
     <dependency> 
     <groupId>com.example.whizbang</groupId> 
     <artifactId>build-tools</artifactId> 
     <version>1.0</version> 
     </dependency> 
    </dependencies> 
    </plugin> 

FindBugs的是更棘手的,我通常会保留原样,有时仅使用@SuppressFBWarnings来自:

<dependency> 
     <groupId>com.google.code.findbugs</groupId> 
     <artifactId>annotations</artifactId> 
     <version>3.0.1</version> 
    </dependency>