The ideal solution is to simply delete these lines and let the version be managed by the core (not plugin) BOM, which is possible as of https://github.com/jenkinsci/jenkins/pull/9288; however, it would imply raising the minimum core version supported by this repository to 2.459 or higher, something that is likely too aggressive at this point in time.
https://github.com/jenkinsci/plugin-pom/blob/8561e2e8c77c344d0465ec6c77e2e3eedc927c00/pom.xml#L182-L187 hard-codes the Servlet API to EE 8 (the last version with
javax
imports), which means that when core is upgraded to EE 9 and plugins upgrade their core baseline to that version, their tests will start failing, even if they have been otherwise prepared with a test harness that supports both EE 8 and EE 9 (see https://github.com/jenkinsci/jenkins-test-harness/pull/770). This manifests in strange and hard-to-debug errors, like not being able to importjakarta
servlet types, or the compatibility methods introduced in https://github.com/jenkinsci/javax-servlet-api/pull/5 not existing (because the wrongjavax
version of thejakarta.servlet-api
takes precedence over the package delivering the compatibility methods).The ideal solution is to simply delete these lines and let the version be managed by the core (not plugin) BOM, which is possible as of https://github.com/jenkinsci/jenkins/pull/9288; however, it would imply raising the minimum core version supported by this repository to 2.459 or higher, something that is likely too aggressive at this point in time.