Add style check exclusion rule example

- Remove ProtoBuf generated code from findbugs,checkstyle,pmd.
- Workaround for findbugs issue running findbugs:findbugs goal
- Added notes to cross-reference others

Change-Id: I5d23b61480a2bdba8d27d6ed0d92728021c240a2
diff --git a/conf/findbugs/exclude.xml b/conf/findbugs/exclude.xml
new file mode 100644
index 0000000..b6a240a
--- /dev/null
+++ b/conf/findbugs/exclude.xml
@@ -0,0 +1,14 @@
+<FindBugsFilter>
+     <!--
+        Note: Exclusion definition exists in multiple places.
+        - In file ${findbugs.excludeFilterFile} defined at top of pom.xml (this file)
+        - maven-checkstyle-plugin configuration in pom.xml
+        - maven-pmd-plugin configuration in pom.xml
+     -->
+     <Match>
+       <Class name="~net.onrc.onos.datastore.RCProtos(.*)?" />
+     </Match>
+     <Match>
+       <Class name="~com.tinkerpop.blueprints.impls.ramcloud.RamCloudGraphProtos(.*)?" />
+     </Match>
+</FindBugsFilter>
diff --git a/pom.xml b/pom.xml
index 2bd6030..32fff07 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,6 +33,9 @@
     <powermock.version>1.5.1</powermock.version>
     <restlet.version>2.1.4</restlet.version>
     <cobertura-maven-plugin.version>2.6</cobertura-maven-plugin.version>
+    <findbugs-plugin.version>2.5.3</findbugs-plugin.version>
+    <findbugs.effort>Max</findbugs.effort>
+    <findbugs.excludeFilterFile>conf/findbugs/exclude.xml</findbugs.excludeFilterFile>
     <!-- To publish javadoc to github,
      uncomment com.github.github site-maven-plugin and
      see https://github.com/OPENNETWORKINGLAB/ONOS/pull/425
@@ -229,6 +232,16 @@
           </execution>
         </executions>
       </plugin>
+      <!-- Note: the findbugs configuration is also in the reporting section -->
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>findbugs-maven-plugin</artifactId>
+        <version>${findbugs-plugin.version}</version>
+        <configuration>
+          <effort>${findbugs.effort}</effort>
+          <excludeFilterFile>${findbugs.excludeFilterFile}</excludeFilterFile>
+        </configuration>
+      </plugin>
     </plugins>
     <pluginManagement>
       <plugins>
@@ -311,6 +324,13 @@
 	<version>2.11</version>
 	<configuration>
 	  <configLocation>conf/checkstyle/sun_checks.xml</configLocation>
+          <!--
+            Note: Exclusion definition exists in multiple places.
+            - In file ${findbugs.excludeFilterFile} defined at top of pom.xml
+            - maven-checkstyle-plugin configuration in pom.xml
+            - maven-pmd-plugin configuration in pom.xml
+          -->
+          <excludes>**/RCProtos.java,**/RamCloudGraphProtos.java</excludes>
 	</configuration>
 	<reportSets>
 	  <reportSet>
@@ -320,11 +340,14 @@
 	  </reportSet>
 	</reportSets>
       </plugin>
+      <!-- Note: the findbugs configuration is also in the build section -->
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>findbugs-maven-plugin</artifactId>
-        <version>2.5.3</version>
+        <version>${findbugs-plugin.version}</version>
         <configuration>
+          <effort>${findbugs.effort}</effort>
+          <excludeFilterFile>${findbugs.excludeFilterFile}</excludeFilterFile>
           <reportPlugins>
             <plugin>
               <groupId>org.codehaus.mojo</groupId>
@@ -337,6 +360,18 @@
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-pmd-plugin</artifactId>
         <version>3.0.1</version>
+        <configuration>
+          <!--
+            Note: Exclusion definition exists in multiple places.
+            - In file ${findbugs.excludeFilterFile} defined at top of pom.xml
+            - maven-checkstyle-plugin configuration in pom.xml
+            - maven-pmd-plugin configuration in pom.xml
+          -->
+          <excludes>
+            <exclude>**/RCProtos.java</exclude>
+            <exclude>**/RamCloudGraphProtos.java</exclude>
+          </excludes>
+        </configuration>
       </plugin>
       <plugin>
 	<groupId>org.apache.maven.plugins</groupId>