> Am 20.05.2024 um 22:23 schrieb 'Jesse Glick' via Jenkins Developers 
> <jenkinsci-dev@googlegroups.com>:
> 
> On Sat, May 18, 2024 at 2:43 PM Ullrich Hafner <ullrich.haf...@gmail.com 
> <mailto:ullrich.haf...@gmail.com>> wrote:
>> It seems that the Maven SpotBugs and the Maven Flatten plugin are not 
>> compatible when used together.
> 
> They are in general.
> 
>> I am using a SpotBugs exclusion filter from another jar file and SpotBugs 
>> seems to create a zero length copy of that file when the flatten plugin is 
>> active.
> 
> Not sure offhand why a zero-length file, but how specifically do you use a 
> filter from another JAR file? SpotBugs filters should not be packed into 
> production JAR files to begin with. I think you are better off simply copying 
> the filter into a new destination in `src/spotbugs/excludesFilter.xml` (and 
> then removing entries as the corresponding bug types are either fixed, or 
> suppressed via annotation).
> 

The filter and my CheckStyle and PMD configuration files are in an external 
artifact so I do not need to copy the file into all my projects (no 
duplication). So I can make changes to the coding style in one central project. 
Like a parent POM just for the coding style settings. Somehow CheckStyle and 
PMD do not care about the flattening but SpotBugs extracts the filter XML into 
an empty file. (Not every time but sometimes, so this might be a race condition 
somewhere).

>> I wanted to ask why we need the maven flatten plugin for the incremental 
>> builds?
> 
> The answer is complicated but you can read JEP-305 if you really want to know.
>  
>> Is this plugin optional?
> 
> No.
>  
>> what happens if I set the property -Dflatten.flatten.skip in my Jenkinsfile? 
>> Are then incremental builds still created?
> 
> No, things will be broken.

Ok, thanks. 

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/467716FA-619B-408F-ABAF-95E0634D1FAE%40gmail.com.

Reply via email to