<properties> ...
<checkstyle.config.file.path>config/checkstyle.xml</checkstyle.config.file.path><checkstyle.supressions.path>config/checkstyle-suppressions.xml</checkstyle.supressions.path><findbugs.annotation>3.0.1</findbugs.annotation> ...
</properties><dependencies> ...
<dependency><groupId>com.google.code.findbugs</groupId><artifactId>annotations</artifactId><version>${findbugs.annotation}</version></dependency> ...
</dependencies><build><pluginManagement><plugins> ...
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-checkstyle-plugin</artifactId><version>2.17</version><configuration><configLocation>${checkstyle.config.file.path}</configLocation><suppressionsLocation>${checkstyle.supressions.path}</suppressionsLocation><consoleOutput>true</consoleOutput><excludes>**/generated**/**</excludes></configuration><executions><execution><phase>package</phase><goals><goal>check</goal></goals></execution></executions></plugin> ...
</plugins></pluginManagement></build><profiles> ...
<profile><id>code-check</id><activation><activeByDefault>true</activeByDefault></activation><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-checkstyle-plugin</artifactId><inherited>false</inherited><executions><execution><!--This matches and thus overrides--><id>checkstyle</id><phase>none</phase></execution></executions></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-pmd-plugin</artifactId><version>3.8</version><configuration><targetJdk>${jdk.version}</targetJdk><verbose>true</verbose><excludes><excludes>**/generated/**/*</excludes></excludes></configuration><executions><execution><phase>package</phase><goals><goal>check</goal></goals></execution></executions></plugin><plugin><groupId>org.codehaus.mojo</groupId><artifactId>findbugs-maven-plugin</artifactId><version>3.0.5</version><configuration><!--
Enables analysis which takes more memory but finds more bugs.
If you run out of memory, changes the value of the effort element
to 'low'.
--><effort>Max</effort><!-- Reports all bugs (other values are medium and max) --><threshold>Low</threshold><!-- Produces XML report --><xmlOutput>true</xmlOutput><findbugsXmlOutputDirectory>${project.build.directory}/findbugs</findbugsXmlOutputDirectory><excludeFilterFile>${project.basedir}/../config/findbugs-exclude.xml</excludeFilterFile></configuration><executions><!-- Ensures that FindBugs inspects source code when project is compiled. --><execution><id>analyze-compile</id><phase>compile</phase><goals><goal>check</goal></goals></execution></executions></plugin></plugins></build></profile> ...
</profiles>
config\checkstyle.xml
<?xml version="1.0"?><!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.1//EN"
"http://www.puppycrawl.com/dtds/configuration_1_1.dtd"><!-- commons lang customization of default Checkstyle behavior --><modulename="Checker"><propertyname="localeLanguage"value="en"/><modulename="FileTabCharacter"><propertyname="fileExtensions"value="java,xml"/></module><modulename="TreeWalker"><modulename="EmptyStatement"/><!--module name="EmptyBlock"/--><modulename="LeftCurly"/><modulename="NeedBraces"/><modulename="RightCurly"/><modulename="AvoidNestedBlocks"/><modulename="HiddenField"><propertyname="tokens"value="VARIABLE_DEF"/></module><modulename="OneStatementPerLine"/><modulename="DeclarationOrder"/><modulename="DefaultComesLast"/><modulename="VisibilityModifier"><propertyname="protectedAllowed"value="true"/></module><modulename="FinalClass"/><modulename="InterfaceIsType"/><modulename="HideUtilityClassConstructor"/><!--<module name="MutableException"/>--><modulename="ThrowsCount"><propertyname="max"value="5"/></module><!--<module name="InnerTypeLast"/> cant find--><!--module name="AvoidStarImport"/--><modulename="RedundantImport"/><modulename="UnusedImports"/><modulename="NeedBraces"/><modulename="LineLength"><propertyname="max"value="180"/></module><modulename="SimplifyBooleanReturn"/><modulename="NestedForDepth"><propertyname="max"value="6"/></module><modulename="NestedIfDepth"><propertyname="max"value="4"/></module><modulename="NestedTryDepth"><propertyname="max"value="2"/></module></module><modulename="FileLength"><propertyname="max"value="1000"/></module></module>
config\checkstyle-suppressions.xml
<?xml version="1.0"?><!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.0//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd"><suppressions><suppresschecks="."files="[\\/]target[\\/]"/><suppressfiles="Application\.java"checks="[a-zA-Z0-9]*"/></suppressions>