It seems that the Maven SpotBugs and the Maven Flatten plugin are not compatible when used together.
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.
I wanted to ask why we need the maven flatten plugin for the incremental builds?
Is this plugin optional?
what happens if I set the property -Dflatten.flatten.skip in my Jenkinsfile? Are then incremental builds still created?
Am 20.05.2024 um 22:23 schrieb 'Jesse Glick' via Jenkins Developers <jenkin...@googlegroups.com>:On Sat, May 18, 2024 at 2:43 PM Ullrich Hafner <ullrich...@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).
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.
SpotBugs extracts the filter XML into an empty file. (Not every time but sometimes, so this might be a race condition somewhere).