When using @Grab with a package that is already bundled inside a plugin, the version inside the plugin is used instead of the one defined in @Grab.
Example to reproduce:
- Install Blue Ocean plugin (1.22.0) on vanilla Jenkins (2.204.2) (make sure AWS Steps plugin is not installed).
- Create a pipeline job with the following content and disabled sandbox:
Without Blue Ocean plugin installed the job is able to execute the method.