Enforce spotbugs by default 77/83877/3
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 21 Aug 2019 17:31:58 +0000 (19:31 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 21 Aug 2019 18:47:41 +0000 (20:47 +0200)
This exposes a new property, odlparent.spotbugs.enforce, which
controls whether spotbugs-maven-plugin should fail the build when
any violations are found.

JIRA: ODLPARENT-205
Change-Id: Id1bd3f2e7941af023e2bbdc9c435d7d5c9e009e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bundles-test-lib/pom.xml
bundles4-test/pom.xml
features-test/pom.xml
filter-manifest-plugin/pom.xml
odlparent/pom.xml

index 35f5934506c16c5f4629a038981dff5710d7c6ba..437447567603aa885b7a6a68c492bd636589a3fc 100644 (file)
           <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
         </configuration>
       </plugin>
-      <plugin>
-        <groupId>com.github.spotbugs</groupId>
-        <artifactId>spotbugs-maven-plugin</artifactId>
-        <configuration>
-          <failOnError>true</failOnError>
-        </configuration>
-      </plugin>
     </plugins>
   </build>
 
index 2fa94265e910a48fb69fd6766ee6812ec38bdae7..c7fa9c41f0487c1a34c3f763b46b11f6f2dc5ae2 100644 (file)
           <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
         </configuration>
       </plugin>
-      <plugin>
-        <groupId>com.github.spotbugs</groupId>
-        <artifactId>spotbugs-maven-plugin</artifactId>
-        <configuration>
-          <failOnError>true</failOnError>
-        </configuration>
-      </plugin>
     </plugins>
   </build>
 
index 7d726b32374f139fa8167bad6a5d258e2932e63b..050a78079da9be46560d5909edc1f463ef9f761f 100644 (file)
     <packaging>bundle</packaging>
     <name>ODL :: odlparent :: ${project.artifactId}</name>
 
+    <properties>
+        <odlparent.spotbugs.enforce>false</odlparent.spotbugs.enforce>
+    </properties>
+
     <dependencies>
         <!-- Dependencies for pax exam karaf container -->
         <dependency>
index 97a316532eb5947e8d6546cfe64023ff95c30889..833a4cd3b702e855b41c590776fb934fc4a15223 100644 (file)
                     <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>com.github.spotbugs</groupId>
-                <artifactId>spotbugs-maven-plugin</artifactId>
-                <configuration>
-                    <failOnError>true</failOnError>
-                </configuration>
-            </plugin>
         </plugins>
     </build>
 </project>
index 3885a27b2e3eef6b92bb53bfdd923b7ab281cbd5..00d7be0ab1d09ea1b6a22ebcb6492942a3f5b7e0 100644 (file)
          set to 'true' in pom.xml of project which desires to completely skip
          execution. -->
     <odlparent.modernizer.skip>false</odlparent.modernizer.skip>
+
+    <!-- Opt-out from spotbugs-maven-plugin failing the build on violations. Defaults
+         to true. Set to 'false' in pom.xml of project which desires to not enforce
+         no reported violations. -->
+    <odlparent.spotbugs.enforce>true</odlparent.spotbugs.enforce>
+
+    <!-- Opt-out from running spotbugs-maven-plugin at all. Defaults to false,
+         set to 'true' in pom.xml of project which desires to completely skip
+         execution. -->
+    <odlparent.spotbugs.skip>false</odlparent.spotbugs.skip>
   </properties>
 
   <dependencyManagement>
             <!-- Reports all bugs (other values are medium and max) -->
             <threshold>Low</threshold>
             <!-- Build doesn't fail if problems are found -->
-            <failOnError>false</failOnError>
+            <failOnError>${odlparent.spotbugs.enforce}</failOnError>
+            <skip>${odlparent.spotbugs.skip}</skip>
             <!-- References the excluded rules -->
             <excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
             <!-- Produces XML report -->
         <groupId>org.gaul</groupId>
         <artifactId>modernizer-maven-plugin</artifactId>
       </plugin>
+      <plugin>
+        <groupId>com.github.spotbugs</groupId>
+        <artifactId>spotbugs-maven-plugin</artifactId>
+      </plugin>
 
       <!-- Jacoco / Sonar -->
       <plugin>