aherbert commented on a change in pull request #56: Added spotbugs check
URL: https://github.com/apache/commons-csv/pull/56#discussion_r376797766
 
 

 ##########
 File path: pom.xml
 ##########
 @@ -208,6 +208,14 @@
           
<suppressionsLocation>${basedir}/src/main/resources/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>com.github.spotbugs</groupId>
+        <artifactId>spotbugs-maven-plugin</artifactId>
+        <version>${commons.spotbugs.version}</version>
+        <configuration>
+          
<excludeFilterFile>${basedir}/src/main/resources/spotbugs/spotbugs-exclude-filter.xml</excludeFilterFile>
 
 Review comment:
   I suggested `src/main/resources` to avoid cluttering the root. This was 
based on commons-rng which uses the same. However it is only the commons-math 
derived projects that use that location (as they all use the same structure). 
commons-collections and commons-bcel put these files in `src/conf`. Others 
still clutter root with these files.
   
   Anyway this reminded me that CSV already has `src/main/resources` for 
checkstyle, pmd and even findbugs. The commit log shows that I created this 
directory structure so it is my propagation of incorrect file locations to 
blame for that. We can correct this in this PR.
   
   The file for findbugs is basically the same as the one for spotbugs in this 
PR. findbugs is also in the POM. So why not just replace the findbugs sections 
from the POM with spotbugs since findbugs is no longer maintained and rename 
the existing `findbugs-exclude-filter.xml`.
   
   This PR then becomes replace findbugs with spotbugs and add to the default 
goal.
   
   As to where configuration files should be located then [Maven's standard 
directory 
layout](http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html)
 is vague on this for plugin configuration files. It should not be in 
'src/main' as it ends up in the output jar file. So `src/site` which appears in 
the standard directory layout is better than `src/conf` which does not.
   
   As to whether you can you push file renaming in a PR then give it a go and 
we will find out. The result would be renaming the following to use `src/site` 
and updating the POM appropriately for each and swapping findbugs for spotbugs:
   
    ```
   commons-csv/src/main/resources/checkstyle/checkstyle-suppressions.xml
   commons-csv/src/main/resources/findbugs/findbugs-exclude-filter.xml
   commons-csv/src/main/resources/pmd/pmd-ruleset.xml
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to