This sounds like a bug in spotbugs that should be reported. (Spotbugs not the spotbugs-maven-plugin).
As for workarounds don't upgrade would be the trivial one, Otherwise did you try adding the dependency to the <plugin> itself in your pom? (https://maven.apache.org/pom.html#Plugins) Please don't bundle the annotations in your plugins. On Mon, 22 Sept 2025, 20:23 Ullrich Hafner, <[email protected]> wrote: > I’m not sure who is reading the issue tracker for our plugin-pom so I am > asking the same question here as well: > > Maven SpotBugs Plugin >= 4.9.5.0 fails when the JSR 305 annotations are > not on the classpath. For reference see: spotbugs/spotbugs-maven-plugin#1209 > (comment) > <https://github.com/spotbugs/spotbugs-maven-plugin/issues/1209#event-19823856210> > > This version is not yet released in our parent-pom (only merged so far) > but I think as soon as we release it we will get additional reports from > other people. I tried the new version in my analysis-pom and get failures > now: > > jenkinsci/jquery3-api-plugin#255 > <https://github.com/jenkinsci/jquery3-api-plugin/pull/255> (and > https://github.com/jenkinsci/jquery3-api-plugin/actions/runs/17898491556/job/50888315843?pr=255 > ) > > It might be caused by Jenkins core where we have the exclusion: > > <dependency> > <groupId>com.github.spotbugs</groupId> > <artifactId>spotbugs-annotations</artifactId> > <exclusions> > <exclusion> > <groupId>com.google.code.findbugs</groupId> > <artifactId>jsr305</artifactId> > </exclusion> > </exclusions> > </dependency> > > And plugins do import the annotations with the scope provided. So this > will cause a problem for all plugins soon. Do you have an idea what to do? > I can bundle the JSR 305 library in my plugins but I am not sure if this is > the correct way. > > -- > 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 [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/jenkinsci-dev/B9BCB6F0-5129-4338-8A70-4971993EF4AA%40gmail.com > <https://groups.google.com/d/msgid/jenkinsci-dev/B9BCB6F0-5129-4338-8A70-4971993EF4AA%40gmail.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion visit https://groups.google.com/d/msgid/jenkinsci-dev/CAPzq3pd14-boObZ7YB1iF4oHubY7ow%3Df-a102oT%3DEZ_Z50hAXQ%40mail.gmail.com.
