You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by ab...@apache.org on 2024/12/05 22:40:37 UTC

(ranger) branch ranger-5019 created (now 99cc8f7bc)

This is an automated email from the ASF dual-hosted git repository.

abhi pushed a change to branch ranger-5019
in repository https://gitbox.apache.org/repos/asf/ranger.git


      at 99cc8f7bc RANGER-5019: Fix spotbug checks for sub-modules

This branch includes the following new commits:

     new 99cc8f7bc RANGER-5019: Fix spotbug checks for sub-modules

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(ranger) 01/01: RANGER-5019: Fix spotbug checks for sub-modules

Posted by ab...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

abhi pushed a commit to branch ranger-5019
in repository https://gitbox.apache.org/repos/asf/ranger.git

commit 99cc8f7bc7f9ca1f44b2cb0ab5e0ca47c642430d
Author: Abhishek Kumar <ab...@cloudera.com>
AuthorDate: Thu Dec 5 14:40:08 2024 -0800

    RANGER-5019: Fix spotbug checks for sub-modules
---
 agents-common/dev-support/spotbugsIncludeFile.xml | 64 -----------------------
 pom.xml                                           | 10 ++--
 2 files changed, 7 insertions(+), 67 deletions(-)

diff --git a/agents-common/dev-support/spotbugsIncludeFile.xml b/agents-common/dev-support/spotbugsIncludeFile.xml
deleted file mode 100644
index 9a0a9261a..000000000
--- a/agents-common/dev-support/spotbugsIncludeFile.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<!--
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
--->
-<FindBugsFilter>
-  <!--
-        For now, lets find only critical bugs from static code analyzer
-  -->
-  <Match>
-    <Priority value="1"/>
-    <Not>
-      <Or>
-        <Bug pattern="DM_DEFAULT_ENCODING" />
-        <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" />
-        <Bug pattern="MS_SHOULD_BE_FINAL" />
-        <Bug pattern="RU_INVOKE_RUN" />
-        <Bug pattern="DM_BOXED_PRIMITIVE_FOR_PARSING" />
-        <Bug pattern="NP_BOOLEAN_RETURN_NULL" />
-        <Bug pattern="SE_BAD_FIELD" />
-        <Bug pattern="NP_NULL_ON_SOME_PATH" />
-        <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE" />
-        <Bug pattern="HE_EQUALS_USE_HASHCODE" />
-        <Bug pattern="RC_REF_COMPARISON" />
-        <Bug pattern="MS_SHOULD_BE_REFACTORED_TO_BE_FINAL" />
-        <Bug pattern="RV_EXCEPTION_NOT_THROWN" />
-        <Bug pattern="DMI_INVOKING_TOSTRING_ON_ARRAY" />
-        <Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT" />
-        <Bug pattern="UC_USELESS_CONDITION" />
-        <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
-        <Bug pattern="MS_MUTABLE_COLLECTION" />
-        <Bug pattern="DM_BOXED_PRIMITIVE_TOSTRING" />
-        <Bug pattern="NP_NULL_PARAM_DEREF" />
-        <Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS" />
-        <Bug pattern="IL_INFINITE_RECURSIVE_LOOP" />
-        <Bug pattern="DMI_RANDOM_USED_ONLY_ONCE" />
-        <Bug pattern="UI_INHERITANCE_UNSAFE_GETRESOURCE" />
-      </Or>
-    </Not>
-  </Match>
-  <!-- TODO: enable each priority one by one
-  <Match>
-      <Priority value="2"/>
-  </Match>
-  <Match>
-      <Priority value="3"/>
-  </Match>
-  <Match>
-      <Priority value="4"/>
-  </Match>
-  -->
-
-</FindBugsFilter>
diff --git a/pom.xml b/pom.xml
index 04f5ea76a..2d4ad29f6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,6 +46,7 @@
         <aws-java-sdk.version>1.12.765</aws-java-sdk.version>
         <bouncycastle.version>1.70</bouncycastle.version>
         <cglib.version>2.2.0-b23</cglib.version>
+        <spotbug.failOnViolation>false</spotbug.failOnViolation>
         <checkstyle.failOnViolation>false</checkstyle.failOnViolation>
         <checkstyle.plugin.version>3.1.0</checkstyle.plugin.version>
         <checkstyle.version>8.29</checkstyle.version>
@@ -660,14 +661,17 @@
                 <groupId>com.github.spotbugs</groupId>
                 <artifactId>spotbugs-maven-plugin</artifactId>
                 <version>${spotbugs.plugin.version}</version>
-                <configuration>
-                    <includeFilterFile>./dev-support/spotbugsIncludeFile.xml</includeFilterFile>
-                </configuration>
                 <executions>
                     <execution>
+                        <id>spotbugs-check</id>
                         <goals>
                             <goal>check</goal>
                         </goals>
+                        <phase>verify</phase>
+                        <configuration>
+                            <includeFilterFile>./dev-support/spotbugsIncludeFile.xml</includeFilterFile>
+                            <failOnError>${spotbug.failOnViolation}</failOnError>
+                        </configuration>
                     </execution>
                 </executions>
             </plugin>